Skip to content

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

Open
mjq wants to merge 4 commits into
masterfrom
mjq/v2-spans-trace-status
Open

fix(spans): Set sentry.trace.status on segment spans#6140
mjq wants to merge 4 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.

Comment thread relay-event-normalization/src/eap/mod.rs
@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.

Comment thread relay-event-normalization/src/eap/mod.rs Outdated
@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

Co-authored-by: Sebastian Zivota <loewenheim@users.noreply.github.com>
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