Documentation
¶
Index ¶
- func ContextWithTraceID(ctx context.Context, id trace.TraceID) context.Context
- func NewResource(ctx context.Context, config config.Config) (*resource.Resource, error)
- func ParseTraceID(s string) (trace.TraceID, bool)
- func SetupTracing(ctx context.Context, config config.Config) (func(context.Context) error, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithTraceID ¶
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 ¶
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 ¶
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 ¶
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.