Expand description
OpenTelemetry integration for distributed tracing
This module provides OpenTelemetry support with OTLP export for distributed tracing. It implements W3C Trace Context propagation (traceparent/tracestate headers).
§Features
- W3C Trace Context header propagation
- OTLP export to Jaeger, Tempo, or any OTLP-compatible backend
- Configurable sampling rates
- Request lifecycle spans with semantic conventions
§Configuration
observability {
tracing {
backend "otlp" {
endpoint "http://localhost:4317"
}
sampling-rate 0.1 // 10% of requests
service-name "sentinel"
}
}Structs§
- Otel
Tracer - Request
Span - Trace
Context - Parsed W3C Trace Context
Enums§
- Otel
Error - OpenTelemetry error types
Constants§
- TRACEPARENT_
HEADER - W3C Trace Context header names
- TRACESTATE_
HEADER
Functions§
- create_
traceparent - Create a traceparent header value
- generate_
span_ id - Generate a new span ID (16 hex chars)
- generate_
trace_ id - Generate a new trace ID (32 hex chars)
- get_
tracer - Get the global tracer
- init_
tracer - Initialize the global tracer
- shutdown_
tracer - Shutdown the global tracer