Skip to content

Preserve repeated tracestate header fields - #9023

Open
Vcode2407 wants to merge 1 commit into
open-telemetry:mainfrom
Vcode2407:fix/tracestate-multiple-header-fields
Open

Vcode2407 wants to merge 1 commit into
open-telemetry:mainfrom
Vcode2407:fix/tracestate-multiple-header-fields

Conversation

@Vcode2407

Copy link
Copy Markdown
Contributor

When a carrier sends two tracestate fields, such as bar=baz followed by foo=bar, the propagator currently drops the second field. Read all values through TextMapGetter.getAll() and pass them to the existing parser in the order received, as required by W3C Trace Context.

The regression test fails on main and passes with this change. All 539 API module tests and both Checkstyle tasks passed. The existing extraction benchmark for carriers without tracestate measured 185.52 ± 53.72 ns/op on JDK 25 (one thread, one fork, 15 measurement iterations).

Signed-off-by: Vcode2407 <vkslog69@gmail.com>
@Vcode2407
Vcode2407 requested a review from a team as a code owner November 9, 2026 13:42
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-11-09 14:19 UTC

Investigate required status check failures.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.37%. Comparing base (f02bddc) to head (a4313d5).

Files with missing lines Patch % Lines
...i/trace/propagation/W3CTraceContextPropagator.java 90.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9023      +/-   ##
============================================
+ Coverage     90.35%   90.37%   +0.01%     
- Complexity    11017    11021       +4     
============================================
  Files          1021     1021              
  Lines         30128    30136       +8     
  Branches       3933     3936       +3     
============================================
+ Hits          27221    27234      +13     
+ Misses         1953     1942      -11     
- Partials        954      960       +6     

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

This branch has not been deployed

No deployments
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.

1 participant