Case insensitive keys TextMapGetter
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 215
- Forks
- 49
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 17
Description
As mentioned on https://github.com/typelevel/otel4s/issues/147#issuecomment-1531469127 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 a TextMapGetter 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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing TextMapGetter[Map[String, String]] entry point and the B3 propagator behavior described in the issue. Compare case-sensitive lookup with lower-case gRPC metadata keys and the proposed Map[CIString, String] carrier. Done means the supported getter can resolve the B3 keys from gRPC metadata, with appropriate coverage in the project’s existing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, scala
- Domain
- distributed-systems, observability-sre
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100