Skip to content

retain propagated context for random trace-ids#8263

Merged
jack-berg merged 2 commits intoopen-telemetry:mainfrom
cleverchuk:cc/retain-propagator-context
Apr 9, 2026
Merged

retain propagated context for random trace-ids#8263
jack-berg merged 2 commits intoopen-telemetry:mainfrom
cleverchuk:cc/retain-propagator-context

Conversation

@cleverchuk
Copy link
Copy Markdown
Contributor

@cleverchuk cleverchuk commented Apr 8, 2026

fixes #8264

@cleverchuk cleverchuk force-pushed the cc/retain-propagator-context branch 2 times, most recently from 11a2944 to c4d97f2 Compare April 8, 2026 00:32
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.30%. Comparing base (7daa1f3) to head (9eaaaa7).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8263   +/-   ##
=========================================
  Coverage     90.29%   90.30%           
+ Complexity     7655     7653    -2     
=========================================
  Files           842      842           
  Lines         23083    23084    +1     
  Branches       2317     2317           
=========================================
+ Hits          20843    20845    +2     
+ Misses         1519     1518    -1     
  Partials        721      721           

☔ View full report in Codecov by Sentry.
📢 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.

@cleverchuk cleverchuk force-pushed the cc/retain-propagator-context branch from c4d97f2 to df726d4 Compare April 8, 2026 01:10
@cleverchuk cleverchuk force-pushed the cc/retain-propagator-context branch from b6182c1 to a9d4586 Compare April 8, 2026 02:16
@cleverchuk cleverchuk changed the title retain propagator context for random trace-ids retain propagated context for random trace-ids Apr 8, 2026
@cleverchuk cleverchuk marked this pull request as ready for review April 8, 2026 03:07
@cleverchuk cleverchuk requested a review from a team as a code owner April 8, 2026 03:07
Copy link
Copy Markdown
Contributor

@jkwatson jkwatson left a comment

Choose a reason for hiding this comment

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

lgtm

isTraceIdRandom = true;
// Replace parentContext for sampling with one with RANDOM_TRACE_ID bit set
parentContextForSampler = ROOT_CONTEXT_WITH_RANDOM_TRACE_ID_BIT;
parentContextForSampler = parentContext.with(RANDOM_TRACE_ID_PRIMORDIAL_SPAN);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This means extra allocations for each and every root span, but it seems necessary to be correct.

cc @PeterF778

Copy link
Copy Markdown
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Approving and merging before the 1.61.0 release because I view this as a regression bug introduced in the 1.60.0 release and can't release without it.

@jack-berg jack-berg merged commit aa4400a into open-telemetry:main Apr 9, 2026
27 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot bot commented Apr 9, 2026

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

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.

Propagated context is discarded for random trace-ids

3 participants