telemetry

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggerWithTrace

func LoggerWithTrace(ctx context.Context, logger *zap.Logger) *zap.Logger

LoggerWithTrace returns a logger with trace_id and span_id fields from the context. If the context has no valid span, the original logger is returned unchanged.

Types

type Providers

type Providers struct {
	// contains filtered or unexported fields
}

Providers holds the OTel SDK TracerProvider and MeterProvider. When telemetry is disabled, both fields are nil and Shutdown is a no-op.

func Init

func Init(cfg config.TelemetryConfig, logger *zap.Logger) (*Providers, error)

Init initializes the OTel SDK. When cfg.Enabled is false, it returns a noop Providers (nil tp/mp) without connecting to any external service.

func (*Providers) Shutdown

func (p *Providers) Shutdown(ctx context.Context) error

Shutdown flushes pending spans/metrics and closes exporters. Safe to call on noop Providers (nil tp/mp).

Jump to

Keyboard shortcuts

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