-
Notifications
You must be signed in to change notification settings - Fork 839
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
W3C Baggage Propagator cannot extract multiple baggage headers #6837
Comments
hi @jamesmoessis! I think option 1 would need to be addressed at the spec level, check out this (really) old issue: open-telemetry/opentelemetry-specification#433 |
Interesting, thanks @trask - I did fear it may be an ancient spec issue. Although reading those threads it seems like some other languages may opt for the other option, combining the headers into one. I suppose this would require a re implementation of all the |
Yikes seems like a miss that we don't have this. I don't think its that's difficult to solve at a technical level, but may be hard to drum up interest in a 4+ year old issue.
We could extend
And to your point, we'd need to override this default implementation in all the instrumentations. Hard part seems to be landing this in the spec. If you want to push on that I would be happy to sponsor you working on the issue. |
Thanks @jack-berg for the response. Given your sponsorship on the spec issue I actually had a read of the TextMap extract spec. What I found interesting is this part:
So, by my reading, the spec actually permits the addition of your It might be worth getting more explicit guidance from the spec, but seemingly we may be able to shortcut by not having to go through the slow process of changing the spec. If you disagree I'd be happy to raise a PR on the spec to get it changed, but it would slow down fixing this issue which has actually caused some problems for us in real scenarios. Any thoughts? |
Going up a bit further in the spec we see:
So in total we have:
The last bit is the only thing that gives me pause about adding So if we're obligated to provide Another reason to try to fix this in the spec, and not just in opentelemetry-java, is better interop between languages. I presume that because of the missing |
Describe the bug
The
W3CBaggagePropagator.extract()
is generally not able to follow the baggage specification, which states:Given that the
TextMapGetter.get()
method returns aString
, as opposed toEnumeration<String>
, all instrumentations that I saw return the value for the first header and so some state is lost.Possible solutions
There are two possible solutions in my mind:
The first is to update the
TextMapGetter
with a method that is able to return multiple values for a single header, and propagators such as baggage would call this. To keep it stable it could return have a default method that returns the value ofget()
as some kind of single-valued collection. Then, the baggage propagator could be updated to use this method, and server instrumentations could follow suit to implement this method on their carriers.The other is to go through all instrumentations and perform the "combined in a single header [RFC 7230]" when extracting the "single" baggage header. This seems likely more hacky and specific to baggage extraction, so it's less preferable in my mind.
The text was updated successfully, but these errors were encountered: