tracerprovider

package
v0.225.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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 InitializeForTests() (trace.Tracer, error)

func InitializeForTestsWithPropagatorFormat added in v0.158.0

func InitializeForTestsWithPropagatorFormat(propagatorFormat string) (trace.Tracer, error)

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 RemoteSamplerOptions struct {
	URL         string
	ServiceName string
}

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 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL