fix: restore OTLP HTTP telemetry broken by opentelemetry-otlp 0.31 feature conflict#304
Merged
rubberduck203 merged 3 commits intomainfrom Apr 17, 2026
Merged
Conversation
…ature conflict ## Problem After upgrading opentelemetry-otlp from 0.27 to 0.31 (PR #251), any user with SCOPE_OTEL_PROTOCOL=http would see: opentelemetry configuration failed. Events will not be sent. no http client specified Traces and metrics stopped arriving in the collector entirely. The binary continued running normally, so the failure was silent to users. ## Root cause opentelemetry-otlp 0.31 changed how the default HTTP client is selected (https://github.com/open-telemetry/opentelemetry-rust/blob/opentelemetry-otlp-0.31.1/opentelemetry-otlp/src/exporter/http/mod.rs#L151-L195). A client is only auto-installed when *exactly one* of hyper-client, reqwest-client, or reqwest-blocking-client is enabled. The async-reqwest auto-default has this cfg gate: all( not(feature = "hyper-client"), not(feature = "reqwest-blocking-client"), feature = "reqwest-client" ) Our Cargo.toml explicitly enabled reqwest-client, but did not set default-features = false. The crate's own default feature set includes reqwest-blocking-client (opentelemetry-otlp Cargo.toml line 69: https://github.com/open-telemetry/opentelemetry-rust/blob/opentelemetry-otlp-0.31.1/opentelemetry-otlp/Cargo.toml). With both reqwest-client AND reqwest-blocking-client active, the cfg never matched, http_config.client remained None, and .build() returned ExporterBuildError::NoHttpClient at: https://github.com/open-telemetry/opentelemetry-rust/blob/opentelemetry-otlp-0.31.1/opentelemetry-otlp/src/exporter/http/mod.rs#L195 This was not a problem on 0.27 because HttpConfig::default() always provided a blocking client unconditionally, regardless of feature flags. ## Fix Set default-features = false on opentelemetry-otlp so reqwest-blocking-client is no longer pulled in from crate defaults. Switch the explicit HTTP client feature from reqwest-client (async) to reqwest-blocking-client (blocking). The blocking client is the correct choice here: the OTLP BatchProcessor runs in a plain std::thread, not a tokio task. Using the async reqwest-client caused a secondary panic ("there is no reactor running") when the batch processor thread tried to flush on shutdown. Also re-add trace and internal-logs to the explicit feature list, since these were previously supplied by the now-disabled defaults. ## Verification - Confirmed error reproduces on main: `cargo run -- doctor list` with SCOPE_OTEL_PROTOCOL=http printed the NoHttpClient message. - After fix: no error, and traces appear in Jaeger (OTLP HTTP via local gdev Jaeger service on port 14318). - Two regression tests added to src/shared/logging.rs that call SpanExporter::builder().with_http()...build() and MetricExporter::builder().with_http()...build() and assert Ok. Both tests fail on the pre-fix code and pass after. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
kejadlen
approved these changes
Apr 17, 2026
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.
Problem
After the opentelemetry-otlp 0.27 → 0.31 upgrade (#251), any deployment using
SCOPE_OTEL_PROTOCOL=httpsilently stopped sending traces and metrics. The runtime error:The CLI continues running normally with telemetry disabled, so the failure is invisible to users.
Root cause
opentelemetry-otlp 0.31 changed how the default HTTP client is selected (source). A client is only auto-installed when exactly one of
hyper-client,reqwest-client, orreqwest-blocking-clientis enabled. The async-reqwest auto-default has this cfg gate:Our
Cargo.tomlexplicitly enabledreqwest-clientbut did not setdefault-features = false. The crate's own defaults includereqwest-blocking-client(Cargo.toml:69). With both features active, the cfg never matched,http_config.clientstayedNone, and.build()returnedExporterBuildError::NoHttpClient.This was silent in 0.27 because
HttpConfig::default()always provided a blocking client unconditionally regardless of feature flags.Fix
default-features = falseonopentelemetry-otlpreqwest-client(async) toreqwest-blocking-client(blocking) — correct for this use case since the OTLPBatchProcessorruns in a plainstd::thread, not a tokio task. The async client caused a secondary panic ("there is no reactor running") when the batch thread tried to flush on shutdown.traceandinternal-logsto the explicit feature list (previously supplied by the now-disabled defaults)Testing
mainbefore this fixSpanExporterandMetricExporterHTTP builders returnOk— both fail on pre-fix code withNoHttpClientand pass afterChecklist
cargo testpasses