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

Clarify how compliant implementations should handle invalid baggage entries #137

Open
lachmatt opened this issue Jun 3, 2024 · 3 comments
Assignees

Comments

@lachmatt
Copy link

lachmatt commented Jun 3, 2024

There is inconsistency related to how invalid baggage entries are handled by some existing implementations (e.g java implementation ignores invalid entries on both inject/extract, and propagate valid ones; go implementation ignores all the propagated baggage entries on extract if any of them is invalid).

There is a section in the spec that states:

If a system determines that the value of a baggage entry is not in the format defined in this specification, it MAY remove that entry before propagating the baggage header as part of outgoing requests.

Baggage entries have key, value, and metadata.
Does "value" in the context quoted above mean baggage entry value specifically (in that case, what if key or metadata are invalid), or whole baggage entry?

@xiang17
Copy link

xiang17 commented Jun 6, 2024

The quoted line specifies that "it MAY remove that entry" rather than all the propagated baggage entries.

I'm not familiar with the go library. The go implementation link in your description points to Parse, which looks like during inject. Can you help me point out where is the code that ignores all the propagated baggage entries?

@lachmatt
Copy link
Author

lachmatt commented Jun 6, 2024

I'm not familiar with the go library. The go implementation link in your description points to Parse, which looks like during inject. Can you help me point out where is the code that ignores all the propagated baggage entries?

It is my understanding of the go implementation that Parse is used in Extract part. If Parse returns an error (if it fails to parse any of the members) then all the propagated baggage entries are ignored.

@kalyanaj
Copy link
Contributor

Thanks for raising this issue.

We discussed this in one of the recent working group meetings:

As far as the Baggage spec is concerned, if an invalid value (where any part of the baggage is invalid) is encountered, the behavior is undefined. If it is a goal to be consistent across different language implementations when an invalid value is encountered, we believe the OTel specification should address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants