Skip to content

fix(core): Serialize streamed span status message to sentry.status.message attribute - #21811

Merged
Lms24 merged 5 commits into
developfrom
lms/fix-core-streaming-span-status-message
Jun 30, 2026
Merged

fix(core): Serialize streamed span status message to sentry.status.message attribute#21811
Lms24 merged 5 commits into
developfrom
lms/fix-core-streaming-span-status-message

Conversation

@Lms24

@Lms24Lms24 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Fixes a semi-deliberate oversight (lol) from my end that caused span status messages to be discarded when creating a StreamedSpanJSON from a Span instance. The deliberate part was to get rid of complicated statuses overall. The oversight was that there's a good use case to augment an error status span with a message: We sometimes want to record that an operation tracked by a span errored but explicitly not capture an error for it (since users likely try/catch said operation). Classic example is Connection Refused for databases.

closes#21800

@Lms24
Lms24 marked this pull request as draft June 26, 2026 10:03
@Lms24Lms24 changed the title fix(core): Serialize streamed span status message to sentry.status.message attributefeat(core): Serialize streamed span status message to sentry.status.message attributeJun 26, 2026
@Lms24
Lms24force-pushed the lms/fix-core-streaming-span-status-message branch from fbab8c3 to c18bd3eCompareJune 26, 2026 10:15
@github-actions

github-actionsBot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser27.48 kB--
@sentry/browser - with treeshaking flags25.91 kB--
@sentry/browser (incl. Tracing)46.07 kB+0.14%+61 B 🔺
@sentry/browser (incl. Tracing + Span Streaming)47.81 kB+0.11%+50 B 🔺
@sentry/browser (incl. Tracing, Profiling)50.83 kB+0.08%+38 B 🔺
@sentry/browser (incl. Tracing, Replay)85.31 kB+0.06%+50 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags74.91 kB+0.08%+57 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)90 kB+0.06%+50 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)102.66 kB+0.05%+44 B 🔺
@sentry/browser (incl. Feedback)44.66 kB--
@sentry/browser (incl. sendFeedback)32.26 kB--
@sentry/browser (incl. FeedbackAsync)37.4 kB--
@sentry/browser (incl. Metrics)28.54 kB--
@sentry/browser (incl. Logs)28.78 kB--
@sentry/browser (incl. Metrics & Logs)29.47 kB--
@sentry/react29.27 kB--
@sentry/react (incl. Tracing)48.37 kB+0.1%+48 B 🔺
@sentry/vue32.7 kB+0.13%+40 B 🔺
@sentry/vue (incl. Tracing)47.94 kB+0.14%+63 B 🔺
@sentry/svelte27.5 kB--
CDN Bundle29.89 kB--
CDN Bundle (incl. Tracing)48 kB+0.11%+52 B 🔺
CDN Bundle (incl. Logs, Metrics)31.44 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)49.33 kB+0.07%+34 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics)70.77 kB--
CDN Bundle (incl. Tracing, Replay)85.5 kB+0.06%+43 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)86.78 kB+0.06%+51 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)91.31 kB+0.07%+58 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)92.54 kB+0.06%+48 B 🔺
CDN Bundle - uncompressed88.95 kB--
CDN Bundle (incl. Tracing) - uncompressed145.31 kB+0.1%+131 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed93.65 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed149.28 kB+0.09%+131 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed218.63 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed264.33 kB+0.05%+131 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed268.29 kB+0.05%+131 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed278.02 kB+0.05%+131 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed281.97 kB+0.05%+131 B 🔺
@sentry/nextjs (client)50.75 kB+0.09%+42 B 🔺
@sentry/sveltekit (client)46.46 kB+0.11%+47 B 🔺
@sentry/core/server77.75 kB+0.1%+77 B 🔺
@sentry/core/browser64.06 kB+0.14%+86 B 🔺
@sentry/node-core61.47 kB+0.09%+50 B 🔺
@sentry/node122.79 kB+0.04%+39 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection)69.95 kB--
@sentry/node/light50.45 kB+0.13%+61 B 🔺
@sentry/node - without tracing73.2 kB+0.09%+65 B 🔺
@sentry/aws-serverless84.09 kB+0.09%+69 B 🔺
@sentry/cloudflare (withSentry) - minified180.62 kB+0.09%+162 B 🔺
@sentry/cloudflare (withSentry)446.93 kB+0.11%+457 B 🔺

View base workflow run

@Lms24Lms24 changed the title feat(core): Serialize streamed span status message to sentry.status.message attributefix(core): Serialize streamed span status message to sentry.status.message attributeJun 26, 2026
@Lms24
Lms24 marked this pull request as ready for review June 26, 2026 14:55
@Lms24
Lms24 requested review from a team as code ownersJune 26, 2026 14:55
@Lms24
Lms24 requested review from JPeer264, andreiborza, logaretm, mydea and s1gr1d and removed request for a team, JPeer264 and andreiborzaJune 26, 2026 14:55
@Lms24Lms24 self-assigned this Jun 26, 2026
Comment threadpackages/core/src/utils/spanUtils.ts

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

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 33fa6af. Configure here.

* message as an attribute instead of dropping it. This mirrors the attribute
* Sentry's OTLP ingestion uses for the same purpose.
*/
export const SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE = 'sentry.status.message';

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.

q: I know core doesn't have @sentry/conventions dependency yet, but just for the future we should probably import them from there.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

yup, we need to add conventions to core.

@Lms24
Lms24force-pushed the lms/fix-core-streaming-span-status-message branch from 360ab29 to 118c27dCompareJune 29, 2026 16:36
@Lms24
Lms24 merged commit cb33fbf into developJun 30, 2026
287 checks passed
@Lms24
Lms24 deleted the lms/fix-core-streaming-span-status-message branch June 30, 2026 07:51
Sign up for freeto 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.

Handle span status message on streamed spans

3 participants

@Lms24@logaretm@JPeer264