Documentation ¶
Index ¶
- func InitGlobalTracerProvider(tp TracerProvider, propagator propagation.TextMapPropagator)
- func InitializeForTests() (trace.Tracer, error)
- func InitializeForTestsWithPropagatorFormat(propagatorFormat string) (trace.Tracer, error)
- func NewTextMapPropagator(pf string) (propagation.TextMapPropagator, error)
- type PropagatorFormat
- type RemoteSamplerOptions
- type SamplerOptions
- type SamplerType
- type TracerProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGlobalTracerProvider ¶
func InitGlobalTracerProvider(tp TracerProvider, propagator propagation.TextMapPropagator)
InitGlobalTracerProvider initializes the global trace provider and global text map propagator with the provided values. This function edits the global (process-wide) OTEL trace provider, use with care!
func InitializeForTests ¶ added in v0.158.0
func InitializeForTestsWithPropagatorFormat ¶ added in v0.158.0
func NewTextMapPropagator ¶
func NewTextMapPropagator(pf string) (propagation.TextMapPropagator, error)
NewTextMapPropagator takes a string-like value and returns the corresponding propagation.TextMapPropagator.
Types ¶
type PropagatorFormat ¶
type PropagatorFormat string
PropagatorFormat is an enum-like type representing all the supported OTEL propagator formats.
const ( PropagatorFormatJaeger PropagatorFormat = "jaeger" PropagatorFormatW3C PropagatorFormat = "w3c" )
type RemoteSamplerOptions ¶ added in v0.192.0
type SamplerOptions ¶ added in v0.192.0
type SamplerOptions struct { SamplerType SamplerType Param float64 Remote RemoteSamplerOptions }
type SamplerType ¶ added in v0.192.0
type SamplerType string
const ( SamplerTypeNone SamplerType = "" SamplerTypeConst SamplerType = "const" SamplerTypeProbabilistic SamplerType = "probabilistic" SamplerTypeRateLimiting SamplerType = "rateLimiting" SamplerTypeRemote SamplerType = "remote" )
type TracerProvider ¶
type TracerProvider interface { trace.TracerProvider // Shutdown performs cleanup operations to ensure the trace provider is disposed correctly. Shutdown(ctx context.Context) error }
TracerProvider provides a tracer that can be used to instrument a plugin with tracing.
func NewNoOpTracerProvider ¶ added in v0.258.0
func NewNoOpTracerProvider() TracerProvider
NewNoOpTracerProvider returns a new noopTracerProvider.
func NewTracerProvider ¶
func NewTracerProvider(address string, samplerOpts SamplerOptions, opts tracing.Opts) (TracerProvider, error)
NewTracerProvider returns a new TracerProvider depending on the specified address. It returns a noopTracerProvider if the address is empty, otherwise it returns a new OpenTelemetry TracerProvider.