telemetry

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTracing

func InitTracing(ctx context.Context, cfg TraceConfig) (func(context.Context) error, bool, error)

InitTracing initializes OpenTelemetry tracing from the provided config. It is safe to call multiple times; only the first call will take effect.

func WrapHTTPClient

func WrapHTTPClient(client *http.Client) *http.Client

WrapHTTPClient returns a shallow copy of the client using an OTel transport.

func WrapHTTPTransport

func WrapHTTPTransport(base http.RoundTripper) http.RoundTripper

WrapHTTPTransport returns a RoundTripper that propagates trace context.

Types

type TraceConfig

type TraceConfig struct {
	Enabled     bool
	ServiceName string
	Endpoint    string
	Protocol    string
	Environment string
	Sampler     string
	SamplerArg  string
	SampleRatio float64
}

TraceConfig holds tracing configuration inputs.

func LoadTraceConfig

func LoadTraceConfig(loader *config.Loader) TraceConfig

LoadTraceConfig loads tracing configuration using the shared config loader.

func TraceConfigFromEnv

func TraceConfigFromEnv() TraceConfig

TraceConfigFromEnv loads tracing configuration from environment variables.

Jump to

Keyboard shortcuts

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