Skip to content

Commit

Permalink
feat: support OpenTelemetry metrics (#115)
Browse files Browse the repository at this point in the history
* feat: support OpenTelemetry metrics

* feat: support OpenTelemetry metrics

* feat: support OpenTelemetry metrics

* feat: support OpenTelemetry metrics

* feat: support OpenTelemetry metrics

* test: expand unit tests

* test: expand unit tests
  • Loading branch information
evansims authored Aug 29, 2024
1 parent d1fa227 commit 0887f1c
Show file tree
Hide file tree
Showing 31 changed files with 2,037 additions and 6 deletions.
4 changes: 4 additions & 0 deletions api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
"strings"
"time"
"unicode/utf8"

"github.com/openfga/go-sdk/internal/telemetry"
)

var (
Expand Down Expand Up @@ -67,6 +69,8 @@ func NewAPIClient(cfg *Configuration) *APIClient {
if cfg.Credentials == nil {
cfg.HTTPClient = http.DefaultClient
} else {
cfg.Credentials.Context = context.Background()
telemetry.Bind(cfg.Credentials.Context, telemetry.Get(telemetry.TelemetryFactoryParameters{Configuration: cfg.Telemetry}))
var httpClient, headers = cfg.Credentials.GetHttpClientAndHeaderOverrides()
if len(headers) > 0 {
for idx := range headers {
Expand Down
Loading

0 comments on commit 0887f1c

Please sign in to comment.