-
Notifications
You must be signed in to change notification settings - Fork 36
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
Case insensitive keys TextMapGetter #191
Comments
I thought this might have a been an issue with the Java B3 propagator at first, but this does all seem to come down to the |
I'm always reluctant with dependencies, but I think most practical uses will be case-insensitive. The library itself has been quite stable. There's a proposal for a 2.0 that has a lot of merit in a vacuum, but the ecosystem churn continues to make me queasy. I'm mildly 👍 on this, but I wonder what others think. |
I'm not certain this works very well. while it's easy to implement Edit: incidentally, your hope will be in vain; the two Java implementations that use |
The spec wants to come out and say things are case-insensitive, but because it abstracts over protocols, can't. On setter:
On getter:
In practice, some text map getters normalize their keys, and some others don't. Oof. |
I looked into this again. It seems the problem only comes when a caller uses I've confirmed that this 100% fixes the problem of case sensitivity for my use case, which is using the b3 propagator for grpc requests. Every propagator does a |
As mentioned on #147 (comment) I was seeing an issue where a gRPC server was not linking spans to a distributed trace. This turned out to be because I was using the provided
TextMapGetter[Map[String, String]]
and gRPC metadata keys are lower case. In my case I am using the B3 propagator so it would have been trying to find[X-B3-TraceId, X-B3-SpanId, X-B3-Sampled]
in["x-b3-traceid", "x-b3-spanid", "x-b3-sampled"]
.To resolve this I changed my carrier type to a
Map[CIString, String]
and wrote aTextMapGetter
implementation for that type.Is this the correct way to deal with this? If so, shall we provide the
Map[CIString, String]
TextMapGetter
instance in this lib?The text was updated successfully, but these errors were encountered: