Skip to content

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

Open
Lms24 wants to merge 5 commits into
developfrom
lms/fix-core-streaming-span-status-message
Open

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

Conversation

@Lms24

@Lms24 Lms24 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
@Lms24 Lms24 changed the title fix(core): Serialize streamed span status message to sentry.status.message attribute feat(core): Serialize streamed span status message to sentry.status.message attribute Jun 26, 2026
@Lms24 Lms24 force-pushed the lms/fix-core-streaming-span-status-message branch from fbab8c3 to c18bd3e Compare June 26, 2026 10:15
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.48 kB - -
@sentry/browser - with treeshaking flags 25.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 flags 74.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/react 29.27 kB - -
@sentry/react (incl. Tracing) 48.37 kB +0.1% +48 B 🔺
@sentry/vue 32.7 kB +0.13% +40 B 🔺
@sentry/vue (incl. Tracing) 47.94 kB +0.14% +63 B 🔺
@sentry/svelte 27.5 kB - -
CDN Bundle 29.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 - uncompressed 88.95 kB - -
CDN Bundle (incl. Tracing) - uncompressed 145.31 kB +0.1% +131 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 93.65 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.28 kB +0.09% +131 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.63 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.33 kB +0.05% +131 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.29 kB +0.05% +131 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.02 kB +0.05% +131 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 281.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/server 77.75 kB +0.1% +77 B 🔺
@sentry/core/browser 64.06 kB +0.14% +86 B 🔺
@sentry/node-core 61.47 kB +0.09% +50 B 🔺
@sentry/node 122.79 kB +0.04% +39 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB - -
@sentry/node/light 50.45 kB +0.13% +61 B 🔺
@sentry/node - without tracing 73.2 kB +0.09% +65 B 🔺
@sentry/aws-serverless 84.09 kB +0.09% +69 B 🔺
@sentry/cloudflare (withSentry) - minified 180.62 kB +0.09% +162 B 🔺
@sentry/cloudflare (withSentry) 446.93 kB +0.11% +457 B 🔺

View base workflow run

@Lms24 Lms24 changed the title feat(core): Serialize streamed span status message to sentry.status.message attribute fix(core): Serialize streamed span status message to sentry.status.message attribute Jun 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 owners June 26, 2026 14:55
@Lms24 Lms24 requested review from JPeer264, andreiborza, logaretm, mydea and s1gr1d and removed request for a team, JPeer264 and andreiborza June 26, 2026 14:55
@Lms24 Lms24 self-assigned this Jun 26, 2026
Comment thread packages/core/src/utils/spanUtils.ts

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

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
Member Author

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 Lms24 force-pushed the lms/fix-core-streaming-span-status-message branch from 360ab29 to 118c27d Compare June 29, 2026 16:36
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.

Handle span status message on streamed spans

3 participants