Skip to content

Fix Jaeger propagator baggage header case sensitivity - #8496

Merged
jack-berg merged 3 commits into
open-telemetry:mainfrom
thswlsqls:fix/jaeger-baggage-case-insensitive-key
Jul 13, 2026
Merged

Fix Jaeger propagator baggage header case sensitivity#8496
jack-berg merged 3 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 91.60%. Comparing base (bf29609) to head (356dcba).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8496   +/-   ##
=========================================
  Coverage     91.59%   91.60%           
  Complexity    10312    10312           
=========================================
  Files          1013     1013           
  Lines         27273    27274    +1     
  Branches       3202     3202           
=========================================
+ Hits          24982    24984    +2     
  Misses         1563     1563           
+ Partials        728      727    -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.
@jkwatson

Copy link
Copy Markdown
Contributor

needs a rebase for the changelog

@jack-berg
jack-berg merged commit b1bf80b into open-telemetry:main Jul 13, 2026
28 checks passed
@otelbot

otelbot Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @thswlsqls! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

@thswlsqls
thswlsqls deleted the fix/jaeger-baggage-case-insensitive-key branch July 17, 2026 02:31
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