Summary#
- Adds a
[telemetry]config section (opt-in, off by default) with OTLP gRPC export viaopentelemetry-otlp+tonic - New
crates/relay/src/telemetry.rs: layered subscriber —fmtlayer always present, OTel layer added whentelemetry.enabled = true;OtelGuardflushes buffered spans on graceful shutdown viaDrop OtelMakeSpaninapp.rsreplaces the defaultTraceLayer::make_span_with; extracts W3Ctraceparent/tracestateheaders viaTraceContextPropagatorso upstream proxy traces are joined#[tracing::instrument]onopen_poolandrun_migrationswithdb.system = "sqlite"span attribute- Env overrides:
EZPDS_TELEMETRY_ENABLED,EZPDS_OTLP_ENDPOINT,OTEL_SERVICE_NAME - 7 new config tests; 72 tests pass; clippy clean
Test plan#
-
cargo test --workspacepasses -
cargo clippy --workspace -- -D warningsclean - Default config (
telemetry.enabled = false) — stdout only, no OTLP connection - With
telemetry.enabled = true+docker run -d --name jaeger -p 16686:16686 -p 4317:4317 jaegertracing/all-in-one:latest— traces appear in Jaeger at http://localhost:16686 - Send request with
traceparentheader — Jaeger shows it as child of upstream trace