Skip to content

Fix Jaeger propagator baggage header case sensitivity#8496

Open
thswlsqls wants to merge 2 commits into
open-telemetry:mainfrom
thswlsqls:fix/jaeger-baggage-case-insensitive-key
Open

Fix Jaeger propagator baggage header case sensitivity#8496
thswlsqls wants to merge 2 commits into
open-telemetry:mainfrom
thswlsqls:fix/jaeger-baggage-case-insensitive-key

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Description

  • JaegerPropagator.getBaggageFromHeader() matched baggage keys case sensitively (uberctx-, jaeger-baggage), so carriers that return header keys in their original case (e.g. undertow 1.7 sends Uberctx-Key, Jaeger-Baggage) had their baggage silently dropped.
  • Lowercase the carrier key with key.toLowerCase(Locale.ROOT) before matching the prefix and header name; the value lookup still uses the original key.
  • Mirrors the sibling OtTracePropagator.extract(), which already lowercases the key (#5840). Jaeger was missed.

Testing done

  • Added JaegerPropagatorTest#extract_baggageOnly_capitalizedHeaders covering both a capitalized Uberctx-* prefix and a capitalized Jaeger-Baggage header.
  • ./gradlew :extensions:trace-propagators:check — 39 tests passed in JaegerPropagatorTest, full module check green.
  • No public API change: private method, jApiCmp produced no apidiff change.
  • Added a ## Unreleased entry in CHANGELOG.md.

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.77%. Comparing base (824334c) to head (9ba35ce).
⚠️ Report is 42 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8496   +/-   ##
=========================================
  Coverage     78.77%   78.77%           
- Complexity     8579     8580    +1     
=========================================
  Files          1009     1009           
  Lines         28993    28994    +1     
  Branches       3599     3599           
=========================================
+ Hits          22839    22841    +2     
  Misses         5311     5311           
+ Partials        843      842    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jack-berg jack-berg added the needs author feedback Waiting for additional feedback from the author label Jul 2, 2026
@thswlsqls thswlsqls marked this pull request as ready for review July 4, 2026 09:07
@thswlsqls thswlsqls requested a review from a team as a code owner July 4, 2026 09:07
@thswlsqls

Copy link
Copy Markdown
Contributor Author

Ready for review — CI is green.

@github-actions github-actions Bot removed the needs author feedback Waiting for additional feedback from the author label Jul 5, 2026
Map<String, String> carrier = new LinkedHashMap<>();
// Some TextMapGetters return header keys in their original case (e.g. undertow 1.7), so baggage
// matching must be case insensitive.
carrier.put("Uberctx-some-key", "value");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use the constant for the prefix but upper-case it, or init-cap it? I think it would be good use the constants, like in the other tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — switched to BAGGAGE_PREFIX/BAGGAGE_HEADER upper-cased so it still exercises the case-insensitive path, matching the other tests.

@opentelemetry-pr-dashboard

Copy link
Copy Markdown

This PR has review comments. Review suggestions, whether from maintainers or automated reviewers, aren't always correct or required. Please evaluate each comment on its merits, then make sure each thread has a clear outcome.

For example, link to the commit if you applied a suggestion, explain why it wasn't applied, or ask a follow-up question.

Automation flags a PR for human review once every review thread has a reply or is marked as resolved.

Status across open PRs is visible on the pull request dashboard.

Replace the hardcoded "Uberctx-some-key"/"Jaeger-Baggage" literals with
BAGGAGE_PREFIX/BAGGAGE_HEADER upper-cased via Locale.ROOT, matching the other
tests in this file. Still exercises the case-insensitive matching path; no
assertion changes.
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

Successfully merging this pull request may close these issues.

3 participants