Skip to content

ref(core): Add trace propagation context#1212

Open
szokeasaurusrex wants to merge 2 commits into
szokeasaurusrex/split-mod-performancefrom
szokeasaurusrex/trace-propagation-context
Open

ref(core): Add trace propagation context#1212
szokeasaurusrex wants to merge 2 commits into
szokeasaurusrex/split-mod-performancefrom
szokeasaurusrex/trace-propagation-context

Conversation

@szokeasaurusrex

@szokeasaurusrex szokeasaurusrex commented Jun 30, 2026

Copy link
Copy Markdown
Member

Introduce TracePropagationContext as the preferred representation for Sentry trace propagation metadata. Keep SentryTrace as a deprecated compatibility type so existing callers can continue to construct and pass the old type while new code uses the more general context API.

Add a fallible header parser and a renamed transaction continuation method for the new context type. Update internal and OpenTelemetry call sites to use the new API.

References #1200
References RUST-252

@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review June 30, 2026 11:33
@szokeasaurusrex szokeasaurusrex requested a review from lcian as a code owner June 30, 2026 11:33
@linear-code

linear-code Bot commented Jun 30, 2026

Copy link
Copy Markdown

RUST-252

@szokeasaurusrex szokeasaurusrex marked this pull request as draft June 30, 2026 11:34
@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review June 30, 2026 11:37
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/split-mod-performance branch from 87d8439 to 624e9d2 Compare July 7, 2026 11:05
@szokeasaurusrex szokeasaurusrex requested a review from a team as a code owner July 7, 2026 11:05
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/trace-propagation-context branch from 3f34a77 to bedc2a2 Compare July 7, 2026 11:05
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/split-mod-performance branch from 624e9d2 to 1034bb7 Compare July 8, 2026 13:56
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/trace-propagation-context branch 2 times, most recently from b686b94 to 9fae22a Compare July 8, 2026 14:04
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/split-mod-performance branch from 1034bb7 to 83004e9 Compare July 8, 2026 14:04

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9fae22a. Configure here.

context_result = TracePropagationContext::from_sentry_trace(value)
.map_or(context_result, Ok)
.map_err(|_| HeaderParseError::Invalid);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Last sentry-trace header wins

Medium Severity

try_from_headers overwrites a successful parse on every later sentry-trace entry, so the last valid value wins. The previous header parser stopped at the first matching header, so integrations that yield multiple pairs (e.g. Actix/Tower flat_map over header values) can continue the wrong trace when more than one valid value is present.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9fae22a. Configure here.

szokeasaurusrex and others added 2 commits July 9, 2026 15:17
Introduce `TracePropagationContext` as the preferred representation for Sentry trace propagation metadata. Keep `SentryTrace` as a deprecated compatibility type so existing callers can continue to construct and pass the old type while new code uses the more general context API.

Add a fallible header parser and a renamed transaction continuation method for the new context type. Update internal and OpenTelemetry call sites to use the new API.

References [#1200](#1200)
References [RUST-252](https://linear.app/getsentry/issue/RUST-252)
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/split-mod-performance branch from 83004e9 to 6151678 Compare July 9, 2026 13:17
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/trace-propagation-context branch from 9fae22a to 1661031 Compare July 9, 2026 13:17
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