Skip to content

ref(core): Streamline how active spans are set in core - #23254

Merged
mydea merged 4 commits into
developfrom
fn/streamline-active-span-setting-in-core
Aug 11, 2026
Merged

ref(core): Streamline how active spans are set in core#23254
mydea merged 4 commits into
developfrom
fn/streamline-active-span-setting-in-core

Conversation

@mydea

@mydea mydea commented Aug 11, 2026

Copy link
Copy Markdown
Member

Extracted out of #23198, I think this should work...

@mydea
mydea requested a review from andreiborza August 11, 2026 08:43
@mydea mydea self-assigned this Aug 11, 2026

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

Reviewed by Cursor Bugbot for commit 2f4c52a. Configure here.

Comment thread packages/core/src/tracing/trace.ts
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.26 kB - -
@sentry/browser - with treeshaking flags 28.44 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.78 kB - -
@sentry/browser (incl. Tracing) 48.5 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.52 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.35 kB - -
@sentry/browser (incl. Tracing, Replay) 87.94 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.3 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.65 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.32 kB - -
@sentry/browser (incl. Feedback) 47.58 kB - -
@sentry/browser (incl. sendFeedback) 35.08 kB - -
@sentry/browser (incl. FeedbackAsync) 40.23 kB - -
@sentry/browser (incl. Metrics) 31.29 kB - -
@sentry/browser (incl. Logs) 31.55 kB - -
@sentry/browser (incl. Metrics & Logs) 32.24 kB - -
@sentry/react 32.06 kB +0.01% +1 B 🔺
@sentry/react (incl. Tracing) 50.69 kB - -
@sentry/vue 35.32 kB - -
@sentry/vue (incl. Tracing) 50.45 kB - -
@sentry/svelte 30.28 kB - -
CDN Bundle 31.52 kB - -
CDN Bundle (incl. Tracing) 48.81 kB +0.05% +22 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.75 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.78 kB +0.04% +18 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74.3 kB - -
CDN Bundle (incl. Tracing, Replay) 86.41 kB +0.03% +21 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.32 kB +0.04% +27 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 92.11 kB +0.03% +23 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.12 kB +0.03% +25 B 🔺
CDN Bundle - uncompressed 93.59 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.49 kB -0.02% -19 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.06 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.34 kB -0.02% -19 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 228.98 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.74 kB -0.01% -19 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.58 kB -0.01% -19 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.43 kB -0.01% -19 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.26 kB -0.01% -19 B 🔽
@sentry/nextjs (client) 53.24 kB - -
@sentry/sveltekit (client) 48.91 kB - -
@sentry/core/server 65.46 kB +0.01% +4 B 🔺
@sentry/core/browser 51.81 kB +0.04% +19 B 🔺
@sentry/node 117.92 kB +0.03% +32 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 82.05 kB -0.01% -1 B 🔽
@sentry/aws-serverless 91.45 kB +0.04% +30 B 🔺
@sentry/cloudflare (withSentry) - minified 214.07 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) 528.66 kB -0.06% -279 B 🔽

View base workflow run

? (callback: () => T) => {
return withActiveSpan(span, () => {
// Make sure the correct scope is captured on the span
setCapturedScopesOnSpan(span, getCurrentScope(), getIsolationScope());

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.

@andreiborza had to add this too to make tests pass, maybe this was part of the problem you ran into before with tags/scopes not matching properly 🤔

@mydea
mydea marked this pull request as ready for review August 11, 2026 09:23
@mydea
mydea merged commit 1889db8 into develop Aug 11, 2026
273 checks passed
@mydea
mydea deleted the fn/streamline-active-span-setting-in-core branch August 11, 2026 11:14
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