-
Notifications
You must be signed in to change notification settings - Fork 39
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
XCloudTraceContextPropagator assumes lowercase header #365
Comments
Triage: IIRC, we do this for other languages, so we probably should here as well. |
I would have expected the carrier (e.g. http header implementation) to handle this. We should check that first. @mackenziestarr what were you trying to do when you encountered this? Was it with OTel's HTTP library, or something else? |
@dashpole in this case I'm integrating OTel into a thrift server that utilized a TCP transport so the "header" is passed in via a |
Hi @mackenziestarr, I looked into this and I think the TODO comment should have been removed/updated. It is from a very old commit and I think spec might have changed since then - I searched around and found that the current spec around Get method mentions that implementation of Get function is responsible for handling case sensitivity. Since we don't provide an implementation for Let me know if my interpretation of the spec makes sense to you. |
@psx95 should we open an issue upstream? |
@dashpole an issue to update the propagators API spec or to somehow provide commonly used getters ? |
Sorry, I had forgotten context from #365 (comment). @mackenziestarr when you implement your TextMapGetter, that is where the lowercasing should happen. @psx95 you can close the issue once you've removed the comment. |
@psx95 thanks the explanations and links to the spec, it wasn't very intuitive to me that one would need to iterate over entries in the map to test for the header key provided by i was hoping for an API that provided a default implementation of a Map<String, ?> input;
var context = new XCloudTraceContextPropagator(true).extract(Context.current(), input) but understand if that is too specific to my own implementation thanks for your time here @psx95 and @dashpole, we can call this closed |
XCloudTraceContextPropagator
assumes the carrier parameter contains a lowercase headerx-cloud-trace-context
and as a result other valid capitalization styles of this header e.g.X-Cloud-Trace-Context
are not extracted. This constraint makes the propagator class less flexible and I think there is benefit to allowing other common capitalizations of the header.opentelemetry-operations-java/propagators/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java
Lines 93 to 94 in 72be92b
Proposed fix: support
X-Cloud-Trace-Context
in addition to the currently supportedx-cloud-trace-context
this fix seems ideal from a performance perspective (vs. the suggested iterating over the keys and lowercasing them) but might have other implications
The text was updated successfully, but these errors were encountered: