tracerprovider

package
v0.165.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: Apache-2.0 Imports: 14 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 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, 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