Skip to content

Commit

Permalink
feat(client): option to disable tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmalkmus committed Nov 6, 2023
1 parent fe5e4c0 commit 2513b52
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions axiom/client_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package axiom
import (
"net/http"

"go.opentelemetry.io/otel/trace"

"github.com/axiomhq/axiom-go/internal/config"
)

Expand Down Expand Up @@ -90,3 +92,12 @@ func SetNoRetry() Option {
return nil
}
}

// SetNoTracing prevents the [Client] from acquiring a tracer from the global
// tracer provider, even if one is configured.
func SetNoTracing() Option {
return func(c *Client) error {
c.tracer = trace.NewNoopTracerProvider().Tracer(otelTracerName)
return nil
}
}

0 comments on commit 2513b52

Please sign in to comment.