Skip to content

feat(core): Backfill sentry.op on streamed spans#20439

Draft
chargome wants to merge 3 commits intodevelopfrom
cg/streamed-span-op-attribute
Draft

feat(core): Backfill sentry.op on streamed spans#20439
chargome wants to merge 3 commits intodevelopfrom
cg/streamed-span-op-attribute

Conversation

@chargome
Copy link
Copy Markdown
Member

@chargome chargome commented Apr 22, 2026

  • Streamed spans were missing sentry.op because the streaming serialization path passes raw OTel attributes through without inference
  • The non-streamed path gets sentry.op set during export in the SentrySpanExporter — but streamed spans skip the exporter entirely

The fix was to propagate the inferred op via SamplingResult.attributes in the sampler, only when span streaming is enabled

closes #20425

@chargome chargome self-assigned this Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.88 kB - -
@sentry/browser - with treeshaking flags 24.35 kB - -
@sentry/browser (incl. Tracing) 43.81 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 45.6 kB +0.23% +101 B 🔺
@sentry/browser (incl. Tracing, Profiling) 48.73 kB - -
@sentry/browser (incl. Tracing, Replay) 82.98 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 72.5 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 87.67 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 99.93 kB - -
@sentry/browser (incl. Feedback) 42.7 kB - -
@sentry/browser (incl. sendFeedback) 30.55 kB - -
@sentry/browser (incl. FeedbackAsync) 35.55 kB - -
@sentry/browser (incl. Metrics) 27.16 kB - -
@sentry/browser (incl. Logs) 27.29 kB - -
@sentry/browser (incl. Metrics & Logs) 27.98 kB - -
@sentry/react 27.62 kB - -
@sentry/react (incl. Tracing) 46.05 kB - -
@sentry/vue 30.71 kB - -
@sentry/vue (incl. Tracing) 45.62 kB - -
@sentry/svelte 25.89 kB - -
CDN Bundle 28.57 kB - -
CDN Bundle (incl. Tracing) 46.17 kB +0.21% +94 B 🔺
CDN Bundle (incl. Logs, Metrics) 29.95 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 47.21 kB +0.21% +95 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 68.92 kB - -
CDN Bundle (incl. Tracing, Replay) 83.23 kB +0.12% +96 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 84.27 kB +0.12% +99 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 88.71 kB +0.12% +99 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 89.79 kB +0.11% +98 B 🔺
CDN Bundle - uncompressed 83.59 kB - -
CDN Bundle (incl. Tracing) - uncompressed 137.86 kB +0.18% +239 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 87.73 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 141.27 kB +0.17% +239 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 211.31 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 255.3 kB +0.1% +239 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 258.7 kB +0.1% +239 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 268.21 kB +0.09% +239 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 271.6 kB +0.09% +239 B 🔺
@sentry/nextjs (client) 48.58 kB - -
@sentry/sveltekit (client) 44.22 kB - -
@sentry/node-core 58.44 kB +0.17% +95 B 🔺
@sentry/node 175.76 kB +0.07% +116 B 🔺
@sentry/node - without tracing 98.4 kB +0.11% +107 B 🔺
@sentry/aws-serverless 115.43 kB +0.1% +105 B 🔺

View base workflow run

@chargome chargome marked this pull request as ready for review April 22, 2026 09:07
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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.

Reviewed by Cursor Bugbot for commit 58f793c. Configure here.

Comment thread packages/opentelemetry/test/sampler.test.ts Outdated
@chargome chargome marked this pull request as draft April 22, 2026 14:25
@chargome
Copy link
Copy Markdown
Member Author

will find another way of doing this

@chargome chargome force-pushed the cg/streamed-span-op-attribute branch from 73ad7b6 to ae0c9db Compare April 22, 2026 14:58
@chargome chargome changed the title feat(opentelemetry): Propagate inferred sentry.op onto streamed span attributes feat(core): Backfill sentry.op on streamed spans from OTel semantic conventions Apr 22, 2026
@chargome chargome changed the title feat(core): Backfill sentry.op on streamed spans from OTel semantic conventions feat(core): Backfill sentry.op on streamed spans Apr 22, 2026
@JPeer264 JPeer264 removed their request for review April 22, 2026 16:17
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.

Backfill sentry.op for streamed client.http spans

1 participant