ref(core): Add trace propagation context#1212
Open
szokeasaurusrex wants to merge 2 commits into
Open
Conversation
87d8439 to
624e9d2
Compare
3f34a77 to
bedc2a2
Compare
624e9d2 to
1034bb7
Compare
b686b94 to
9fae22a
Compare
1034bb7 to
83004e9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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); | ||
| } |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 9fae22a. Configure here.
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)
83004e9 to
6151678
Compare
9fae22a to
1661031
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Introduce
TracePropagationContextas the preferred representation for Sentry trace propagation metadata. KeepSentryTraceas 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