Skip to content

Do not overwrite existing baggage with empty baggage in JaegerPropagator#8632

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/jaeger-propagator-empty-baggage-overwrite
Draft

Do not overwrite existing baggage with empty baggage in JaegerPropagator#8632
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/jaeger-propagator-empty-baggage-overwrite

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8630

Description

  • getBaggageFromHeader() built a Baggage.builder() for any non-null jaeger-baggage header value, so a header with no parsable key=value entry returned an empty but non-null Baggage. extract() stored it, and Baggage.storeInContext() overwrites unconditionally: under otel.propagators=tracecontext,baggage,jaeger, W3C baggage was silently dropped.
  • Return null when the built baggage is empty; the method is already @Nullable and the caller checks for null.
  • This matches three siblings that already guard it: the uberctx- branch of the same method, OtTracePropagator.extract(), and W3CBaggagePropagator.extractMulti(). Apply baggage limits #8380 added those but left this branch.
  • Well-formed headers, byte accounting, and limits are unchanged.

Testing done

  • Added JaegerPropagatorTest#extract_baggageOnly_withHeader_invalid_keepsExistingBaggage, a @ParameterizedTest over nometa+novalue, user=, an empty header, and a=b=c, each starting from a context holding baggage.
  • Not vacuous: reverting the fix fails all 4 cases.
  • ./gradlew :extensions:trace-propagators:check --rerun-tasks — 135 tests passed.
  • No apidiff (private method body). Added a ## Unreleased CHANGELOG.md entry.
  • *IT and GraalVM native-image tests were not run locally.

@thswlsqls
thswlsqls force-pushed the fix/jaeger-propagator-empty-baggage-overwrite branch from 9a60e5f to eed0c49 Compare July 17, 2026 02:25
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.61%. Comparing base (b86f040) to head (eed0c49).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8632   +/-   ##
=========================================
  Coverage     91.60%   91.61%           
- Complexity    10343    10344    +1     
=========================================
  Files          1013     1013           
  Lines         27352    27355    +3     
  Branches       3215     3216    +1     
=========================================
+ Hits          25057    25060    +3     
  Misses         1567     1567           
  Partials        728      728           

☔ 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.

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.

JaegerPropagator overwrites existing baggage with empty baggage

1 participant