Skip to content

fix(spans): Set sentry.trace.status on segment spans - #6140

Merged
mjq merged 6 commits into
masterfrom
mjq/v2-spans-trace-status
Jun 29, 2026
Merged

mjq merged 6 commits into
masterfrom
mjq/v2-spans-trace-status

Conversation

@mjq

@mjq mjq commented Jun 25, 2026 •

Copy link
Copy Markdown
Member

The product currently exposes sentry.trace.status to users (as trace.status). This is currently only set for v1 spans (extracted from the transaction's trace context's status field). Despite the name, it represents the transaction's status, not the whole trace.

For backwards compatibility we have to expose this on v2 spans as well. This only makes sense on segment spans (but segment enrichment will copy the value to all children). The order of precedence is:

  1. Existing sentry.trace.status attribute (v1 span)
  2. Existing sentry.status attribute (v1 span missing trace context status field)
  3. Span's top-level status field (v2 and OTel spans)

I'm doing this in Relay because it:

  • only involves individual spans (does not depend on a complete segment)
  • is not related to the conversion of spans to EAP trace items

🤖: Used Claude for the test cases

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5e3588e. Configure here.

@mjq
mjq marked this pull request as ready for review June 25, 2026 19:50
@mjq
mjq requested a review from a team as a code owner June 25, 2026 19:50

@loewenheim loewenheim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a temporary measure? Otherwise the sentry.trace.status attribute should be added to conventions.

@mjq

mjq commented Jun 25, 2026 •

Copy link
Copy Markdown
Member Author

@loewenheim

Is this a temporary measure? Otherwise the sentry.trace.status attribute should be added to conventions.

True, I'll add it (as well as sentry.status).

EDIT: getsentry/sentry-conventions#453

mjq and others added 2 commits June 25, 2026 16:17
Co-authored-by: Sebastian Zivota <loewenheim@users.noreply.github.com>
cursor[bot]

This comment was marked as resolved.

@mjq

mjq commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

@loewenheim Updated the PR to bump sentry-conventions to get the constants and then use them.

Note that this would obsolete #6139 if it gets merged first, since this version of sentry-conventions is even newer.

@mjq
mjq requested a review from loewenheim June 26, 2026 15:13
@mjq
mjq enabled auto-merge June 29, 2026 14:28
@mjq
mjq added this pull request to the merge queue Jun 29, 2026
Merged via the queue into master with commit a560dc8 Jun 29, 2026
67 of 69 checks passed
@mjq
mjq deleted the mjq/v2-spans-trace-status branch June 29, 2026 15:30
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.

2 participants