Skip to content

Commit

Permalink
Remove explicit otel injection
Browse files Browse the repository at this point in the history
  • Loading branch information
thokra-nav committed Feb 12, 2024
1 parent 35d4a18 commit ee4800d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/thirdparty/google_token_source/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ package google_token_source
import (
"context"
"fmt"
"net/http"

"github.com/davecgh/go-spew/spew"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"golang.org/x/oauth2"
admin_directory "google.golang.org/api/admin/directory/v1"
"google.golang.org/api/impersonate"
"google.golang.org/api/option"
)

type Builder struct {
Expand Down Expand Up @@ -44,9 +41,8 @@ func (g Builder) impersonateTokenSource(ctx context.Context, delegate bool, scop

spew.Dump(impersonateConfig)

return impersonate.CredentialsTokenSource(ctx, impersonateConfig, option.WithHTTPClient(
&http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)},
))
// Otel transport is added by the library
return impersonate.CredentialsTokenSource(ctx, impersonateConfig)
}

func (g Builder) Admin(ctx context.Context) (oauth2.TokenSource, error) {
Expand Down

0 comments on commit ee4800d

Please sign in to comment.