You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
V2 sends percent-encoded OTEL_EXPORTER_OTLP_HEADERS values unchanged to the collector. For example, Authorization=Bearer%20test-token arrives as Bearer%20test-token, so a collector expecting Bearer test-token rejects the export.
Both the log and trace exporter share parseHeaders() in packages/util/src/observability/otlp.ts, which splits the entries but does not decode their values. The OTLP exporter specification uses the W3C Baggage header format.
Plugins
None
OpenCode version
2.0.27 (V2)
Steps to reproduce
Start a local OTLP/HTTP collector that records request headers.
Set OTEL_EXPORTER_OTLP_ENDPOINT to that collector and OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer%20test-token,x-label=one%2Ctwo.
Emit a log or span and flush the exporter.
Observed: Authorization: Bearer%20test-token and x-label: one%2Ctwo.
Expected: Authorization: Bearer test-token and x-label: one,two.
This reproduces with both production exporters against a loopback collector. The existing fix for raw = characters in header values (#22201) does not address percent decoding; that behavior should remain intact.
Thanks for the detailed report. I reproduced this on 2.0.27 and on the latest dev (d7cfdaa).
Steps:
Point OTEL_EXPORTER_OTLP_ENDPOINT at a local collector that records request headers.
Set OTEL_EXPORTER_OTLP_HEADERS='Authorization=Bearer%20test-token,x-label=one%2Ctwo'.
Run opencode debug paths.
The collector gets requests on both /v1/logs and /v1/traces, and every one has authorization: Bearer%20test-token and x-label: one%2Ctwo instead of the decoded values. As you found, parseHeaders() in packages/util/src/observability/otlp.ts splits the entries but never decodes them. resourceAttributes() in the same file does decode its values.
The script below reproduces it. Related: #22202 / #22201, which fixed raw = in header values but not percent-decoding.
Activity
opencode-agent commentedon Oct 13, 2026
Thanks for the detailed report. I reproduced this on 2.0.27 and on the latest
dev(d7cfdaa).Steps:
OTEL_EXPORTER_OTLP_ENDPOINTat a local collector that records request headers.OTEL_EXPORTER_OTLP_HEADERS='Authorization=Bearer%20test-token,x-label=one%2Ctwo'.opencode debug paths.The collector gets requests on both
/v1/logsand/v1/traces, and every one hasauthorization: Bearer%20test-tokenandx-label: one%2Ctwoinstead of the decoded values. As you found,parseHeaders()inpackages/util/src/observability/otlp.tssplits the entries but never decodes them.resourceAttributes()in the same file does decode its values.The script below reproduces it. Related: #22202 / #22201, which fixed raw
=in header values but not percent-decoding.Reproduction script (repro.sh)
Run it:
bash repro.sh