Skip to content

Commit

Permalink
Utilizing SH Logging Policy for ARM Track 2 SDK Calls (#706)
Browse files Browse the repository at this point in the history
* using SH transport for ARM calls

* fix param

---------

Co-authored-by: tomabraham <tomabraham@microsoft.com>
  • Loading branch information
toma3233 and tomabraham authored Feb 20, 2025
1 parent bbcfe96 commit d1520d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/utils/opts/armopts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ package opts

import (
"net/http"
"os"
"time"

"log/slog"

shPolicy "github.com/Azure/aks-middleware/http/client/azuresdk/policy"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
"github.com/Azure/karpenter-provider-azure/pkg/auth"
Expand All @@ -30,6 +34,9 @@ func DefaultArmOpts() *arm.ClientOptions {
opts.Telemetry = DefaultTelemetryOpts()
opts.Retry = DefaultRetryOpts()
opts.Transport = defaultHTTPClient

logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
opts.PerCallPolicies = append(opts.PerCallPolicies, shPolicy.NewLoggingPolicy(*logger))
return opts
}

Expand Down

0 comments on commit d1520d9

Please sign in to comment.