Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL encoded values for OTEL_EXPORTER_OTLP_HEADERS are not supported #1577

Closed
pyohannes opened this issue Feb 26, 2024 · 0 comments · Fixed by #1578
Closed

URL encoded values for OTEL_EXPORTER_OTLP_HEADERS are not supported #1577

pyohannes opened this issue Feb 26, 2024 · 0 comments · Fixed by #1578
Labels
bug Something isn't working triage:accepted Has been triaged and accepted.

Comments

@pyohannes
Copy link
Contributor

What happened?

The Rust SDK should support URL encoded values in OTEL_EXPORTER_OTLP_HEADERS. For backward compatibility, also non-URL encoded values should be supported.

Both this settings should work:

OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic%20AAA"
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic AAA"

Currently only non-URL encoded values are supported.

Additional context

The OTel specification requires values for OTEL_EXPORTER_OTLP_HEADERS to be formatted conforming with the W3C Baggage specification.

The W3C Baggage spec requires values to be URL encoded:

A value contains a string whose character encoding MUST be UTF-8 [Encoding]. Any characters outside of the baggage-octet range of characters MUST be percent-encoded. Characters which are not required to be percent-encoded MAY be percent-encoded.

This has been discussed in open-telemetry/opentelemetry-specification#3832, the result being that the behavior described in the OTel and W3C specification is desired and SDKs should support URL encoded values.

API Version

main branch, is likely an issue for all released versions

SDK Version

main branch, is likely an issue for all released versions

What Exporters are you seeing the problem on?

OTLP

Relevant log output

$ export OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic%20NzAxN[...]
$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `/home/johannes/Source/opentelemetry-rust/target/debug/basic-otlp`
OpenTelemetry trace error occurred. HTTP status client error (401 Unauthorized) for url (https://otlp-gateway-prod-us-east-0.grafana.net/otlp/v1/traces)
$ export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic NzA[...]"
$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `/home/johannes/Source/opentelemetry-rust/target/debug/basic-otlp`
$
@pyohannes pyohannes added bug Something isn't working triage:todo Needs to be traiged. labels Feb 26, 2024
@TommyCpp TommyCpp added triage:accepted Has been triaged and accepted. and removed triage:todo Needs to be traiged. labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage:accepted Has been triaged and accepted.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants