Skip to content

Commit

Permalink
add gitlab otel
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifosmin Simon committed Oct 21, 2024
1 parent ee217c7 commit af8ec05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/providers/gitlab/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
pv "github.com/goto/guardian/core/provider"
"github.com/goto/guardian/domain"
"github.com/goto/guardian/pkg/log"
"github.com/goto/guardian/pkg/opentelemetry"
"github.com/goto/guardian/utils"
"github.com/xanzy/go-gitlab"
"golang.org/x/sync/errgroup"
Expand Down Expand Up @@ -271,7 +272,8 @@ func (p *provider) getClient(pc domain.ProviderConfig) (*gitlab.Client, error) {
return nil, fmt.Errorf("unable to decrypt credentials: %w", err)
}

client, err := gitlab.NewClient(creds.AccessToken, gitlab.WithBaseURL(creds.Host))
gitlabHTTPClient := opentelemetry.NewHttpClient("GitlabClient")
client, err := gitlab.NewClient(creds.AccessToken, gitlab.WithBaseURL(creds.Host), gitlab.WithHTTPClient(gitlabHTTPClient))
if err != nil {
return nil, fmt.Errorf("unable to create gitlab client: %w", err)
}
Expand Down

0 comments on commit af8ec05

Please sign in to comment.