Repository navigation
Conversation
…tbound proxy opentelemetry-otlp builds its HTTP client from the environment's proxy settings, so with HTTP_PROXY / HTTPS_PROXY / ALL_PROXY set for the proxy repositories and no NO_PROXY entry for the Collector, every export went to the outbound proxy: the exports failed, and to a plain-HTTP endpoint the proxy was sent the payload and OTEL_EXPORTER_OTLP_HEADERS in the clear. Give the metric, span and log exporters a client built with no_proxy(), with the timeout the exporter resolves for its default client, and say in the deployment guide that the proxy variables do not route the export. Fixes #558 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012e6DJbiZTV7AXpNjVtgYrt
schmitch
added this pull request to the merge queue
Nov 17, 2026
Any commits made after this event will not be merged.
This branch has not been deployed
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.
Fixes #558
The problem
opentelemetry-otlp builds its HTTP client with
reqwest::blocking::Client::builder(), which takes the proxy fromHTTP_PROXY/HTTPS_PROXY/ALL_PROXY. With an outbound proxy set for the proxy repositories and noNO_PROXYentry for the Collector, every export went to that proxy, also for the defaulthttp://localhost:4318: the exports failed, and to a plain-HTTP endpoint the proxy was sent the payload andOTEL_EXPORTER_OTLP_HEADERSin the clear.The change
crates/server/src/telemetry.rs: the metric, span and log exporters (the three Forge builds) each get a client built with.no_proxy(), throughWithHttpConfig::with_http_client, which is how opentelemetry-otlp 0.33.1 (the version inCargo.lock) takes a custom client.no_proxy()also turns off the platform's proxy settings (reqwest'ssystem-proxy).direct_clientresolves the timeout the same way the exporter does: the signal'sOTEL_EXPORTER_OTLP_{METRICS,TRACES,LOGS}_TIMEOUT, thenOTEL_EXPORTER_OTLP_TIMEOUT, then 10 s. The client is built on a thread of its own, as the exporter builds its default one, since a blocking client cannot be built on an async worker.crates/server/Cargo.toml: the server names reqwest'sblockingfeature, which it now uses itself (it was already on through opentelemetry-http;Cargo.lockis unchanged).docs/deployment.md: Telemetry says the export connects directly and ignores the proxy variables, and what to do when a backend is reachable through the proxy alone; the Outbound proxy note says the variables route the upstream traffic only.docs/changes/2.2.0/558.fixed.md: the changelog fragment. The issue was inBacklog; it is fixed ahead of its milestone, so the fragment is in the next release's directory and the issue is moved to the2.2.0milestone.Things to decide in review
.no_proxy()over exempting loopback alone, and the guide and the fragment say this. There is no setting to turn the proxy back on for the export.fixed, notsecurity. The headers reached the operator's own egress proxy, and only for a plain-HTTP endpoint (anhttps://endpoint is tunnelled withCONNECT). I filed it under Fixed; rename the fragment to558.security.mdif you judge otherwise.No admin API changes, so there is no web UI screen.
Verification
crates/server/tests/otlp_export.rs(the export asmainsets it up) now runs withHTTP_PROXY,HTTPS_PROXYandALL_PROXY(both cases) pointing at a second local listener standing in for the proxy,NO_PROXYunset andOTEL_EXPORTER_OTLP_HEADERS=api-key=s3cret. It asserts that the proxy was sent nothing and that metrics, traces and logs reach the OTLP receiver with the header. It passes with the change, and fails withtelemetry.rsreverted tomain.cargo fmt --all --check,cargo clippy --workspace --all-targets --all-features -- -D warnings,cargo xtask changelog --check,cargo xtask docs --check,cargo xtask unusedandcargo xtask doc-check: all clean.cargo test -p forge-server --lib --bins --test telemetry --test otlp_export: 291 unit tests, 6 telemetry tests and the export test pass (Docker throughmirror.gcr.io).Not verified locally:
forge-server's integration test binaries, the other crates' tests and the e2e suites. A run of all of the server's binaries (test-parallel.sh -p forge-server) ran out of disk while linking in the session's container, so that is left to CI.https://OTLP endpoint was not exercised.Generated by Claude Code