fix(tracing): wire OTLP pipeline to Jaeger, remove dead ObservabilityConfig#2890
Merged
fix(tracing): wire OTLP pipeline to Jaeger, remove dead ObservabilityConfig#2890
Conversation
…Config `TelemetryBackend::Otlp` was a stub — `build_chrome_layer` returned `None` for any non-Local backend, and opentelemetry-otlp/opentelemetry_sdk had no features enabled so the gRPC transport could not compile anyway. Changes: - add `build_otlp_layer` behind `#[cfg(feature = "otel")]`: SpanExporter (tonic gRPC) → SdkTracerProvider (BatchSpanProcessor + ratio sampler + service_name resource) → global::set_tracer_provider; returns provider handle for graceful flush on drop - add `otel_provider: Option<SdkTracerProvider>` to `TracingGuards` with explicit `Drop` that calls `provider.shutdown()` to flush pending spans - clamp `sample_rate` to `[0.0, 1.0]` with `tracing::warn!` on out-of-range - warn when `otlp_headers_vault_key` is set but not yet wired - fix Cargo.toml: opentelemetry-otlp gets `["grpc-tonic","trace"]`, opentelemetry_sdk gets `["trace"]`; tonic 0.12/0.14 coexistence documented - remove dead `ObservabilityConfig` struct and all re-exports; purge all stale `[observability]` sections from config templates and doc comments - update testing.toml: replace `[observability]` with correct `[telemetry]` block pointing at localhost:4317 - fix docker-compose.tracing.yml comments to reference `[telemetry]` Closes #2881
c5ca06c to
7763684
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TelemetryBackend::Otlp—build_otlp_layercreates a gRPC OTLP exporter (tonic), aSdkTracerProviderwithBatchSpanProcessor+ ratio sampler, and registers it globally viatracing-opentelemetryOtlpGuardtoTracingGuardsthat callsprovider.shutdown()on drop for graceful span flushCargo.toml:opentelemetry-otlp+opentelemetry_sdkhaddefault-features = falsewith no features — addedgrpc-tonic,traceandtracerespectivelyObservabilityConfigstruct and all 9 stale[observability]references across config templates and doc commentstesting.toml: replace[observability]with[telemetry] enabled=true backend="otlp"pointing atlocalhost:4317Root causes fixed (closes #2881)
Three root causes confirmed by investigation:
init_tracingreadsTelemetryConfig([telemetry]), notObservabilityConfig([observability]) — existing config was targeting the wrong keybuild_chrome_layerreturnedNonefor any non-Localbackend —Otlpwas never handledopentelemetry-otlphaddefault-features = falsewith no explicit features, making the gRPC transport unavailable at compile time even if code had existedValidation
cargo clippy --lib --bins --features full --workspace -- -D warnings— cleancargo +nightly fmt --check— cleanbuild_otlp_layer_sample_rate_out_of_range_is_clamped(CI, no network),tracing_guards_drop_with_otel_provider_does_not_panic(CI, no-op provider)#[ignore]live pipeline test available for manual verification with Jaeger runningFollow-up issues
tracing— filed separatelyotlp_headers_vault_keyvault wiring — out of scope for this PR, warns when set but unused