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

OTEL_RESOURCE_ATTRIBUTES values are not parsed as defined per spec #3395

Open
pellared opened this issue Jun 21, 2022 · 3 comments
Open

OTEL_RESOURCE_ATTRIBUTES values are not parsed as defined per spec #3395

pellared opened this issue Jun 21, 2022 · 3 comments
Labels
area:sdk bug Something isn't working

Comments

@pellared
Copy link
Member

pellared commented Jun 21, 2022

From the OTel spec:

The OTEL_RESOURCE_ATTRIBUTES environment variable will contain of a list of key value pairs, and these are expected to be represented in a format matching to the W3C Baggage, except that additional semi-colon delimited metadata is not supported, i.e.: key1=value1,key2=value2. All attribute values MUST be considered strings.

From the W3C spec:

A value contains a URL encoded UTF-8 string. Leading and trailing whitespaces (OWS) are allowed but MUST be trimmed when converting the header into a data structure.

Currently, the values defined in OTEL_RESOURCE_ATTRIBUTES (splitted by ,) are not parsed at all. Source code here.

Found thanks to: open-telemetry/opentelemetry-go#2963

@pellared pellared added bug Something isn't working area:sdk labels Jun 21, 2022
@lgfa29
Copy link

lgfa29 commented Jul 31, 2022

open-telemetry/opentelemetry-specification#2670 updates the Resource spec to take percent-decode into account.

@martinjt
Copy link
Member

Is this still the case @pellared ?

@pellared
Copy link
Member Author

The OTEL_RESOURCE_ATTRIBUTES env var is still still not properly parsed.

It accepts keys that should not be allowed.

They values are not precent decoded as noted #3395 (comment)

Reference: https://www.w3.org/TR/baggage/#definition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:sdk bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants