telemetry

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithTraceID

func ContextWithTraceID(ctx context.Context, id trace.TraceID) context.Context

ContextWithTraceID sets the trace_id that the next root span created with this ctx will use. It has no effect if the span has a parent (e.g. a received traceparent).

func NewResource

func NewResource(ctx context.Context, config config.Config) (*resource.Resource, error)

NewResource describes the service; it is shared by logs and traces so that both reach Grafana with the same service_name/deployment_environment.

func ParseTraceID

func ParseTraceID(s string) (trace.TraceID, bool)

ParseTraceID accepts a 32-character hex id, with or without hyphens (UUID), and converts it into a trace_id. Ids in another format or all zeros are rejected.

func SetupTracing

func SetupTracing(ctx context.Context, config config.Config) (func(context.Context) error, error)

SetupTracing registers the global TracerProvider and propagator (W3C traceparent + baggage). When tracing is off (see Config.IsTracingEnabled) no TracerProvider is registered and otel stays on the no-op provider: spans are not exported, but instrumented code keeps working.

Types

This section is empty.

Jump to

Keyboard shortcuts

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