Repository navigation
feat: support OTLP export through an HTTP forward proxy - #148
enternal111 wants to merge 8 commits into
Conversation
Networks that require an outbound proxy currently cannot export telemetry: the Node.js OTLP HTTP exporters create their own agents and ignore HTTP(S)_PROXY, and opentelemetry-js has no released support for OTEL_EXPORTER_OTLP_PROXY_URL yet (open-telemetry/opentelemetry-js#6932, which also relies on a Node-native agent option that other runtimes such as Bun do not implement). Add an otlpProxyUrl option, read from OPENCODE_OTLP_PROXY_URL or OTEL_EXPORTER_OTLP_PROXY_URL, that wires an https-proxy-agent into the HTTP exporters through the official httpAgentOptions agent factory. The connectivity probe targets the proxy when one is configured.
Applying the proxy agent unconditionally broke exporters pointed at a local collector (for example an OpenTelemetry collector on 127.0.0.1): the request was tunneled to the proxy, which cannot reach the user''s loopback, and every export failed silently. Bypass the proxy for loopback hosts and for hosts matching the standard NO_PROXY list, and make the startup probe follow the same decision.
|
@codex review |
|
@codex security review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2eee83551
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…back Use HttpProxyAgent for http: endpoints so the proxy receives a plain HTTP request instead of a CONNECT to a non-TLS port, and remove the OTEL_EXPORTER_OTLP_PROXY_URL fallback to keep configuration scoped to the OPENCODE_ namespace. Strip unrequested comments per the repository convention.
|
@codex review |
|
@codex security review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@codex security review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c34a791901
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The gRPC exporter does not use the HTTP proxy agent, so the connectivity probe should target the collector endpoint rather than the proxy when the protocol is grpc.
|
@codex review |
|
@codex security review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5647d9f906
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Match NO_PROXY entries against both hostname and hostname:port so an entry like collector.example.com:4318 bypasses as expected, and regenerate bun.lock against registry.npmjs.org to drop mirror URLs introduced by the local development proxy.
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
1 similar comment
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ecd2f49fbd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Match any 127.x.x.x address so collectors bound to non-standard loopback addresses also bypass the proxy.
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e441bdc9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Infer the default port (443 for https, 80 for http) when the endpoint omits it so a NO_PROXY entry like example.com:443 matches https://example.com as expected.
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64aa1abcbe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Match only four-octet IPv4 addresses starting with 127 so a DNS name such as 127.example.com does not bypass the proxy.
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Which problem is this PR solving?
Networks that require an outbound HTTP proxy currently cannot export telemetry: the Node.js OTLP HTTP exporters create their own agents and ignore
HTTP(S)_PROXY, and opentelemetry-js has no released support forOTEL_EXPORTER_OTLP_PROXY_URLyet (open-telemetry/opentelemetry-js#6932, which also relies on a Node-native agent option that other runtimes such as Bun do not implement).Short description of the changes
otlpProxyUrloption, read fromOPENCODE_OTLP_PROXY_URLor the standardOTEL_EXPORTER_OTLP_PROXY_URL, following the same precedence style as the other OTLP settings.https-proxy-agentis wired into the HTTP exporters through the officialhttpAgentOptionsagent factory, so gRPC is unaffected and no exporter is patched.How Has This Been Tested?
bun run typecheckbun run lintbun test(unit suite green, including new config resolution and exporter construction tests)