Skip to content

feat(core): Use getActiveSpan instead of _getSpanFromScope for logs & metrics - #23223

Merged
mydea merged 1 commit into
developfrom
fn/use-getActiveSpan
Aug 11, 2026
Merged

mydea merged 1 commit into
developfrom
fn/use-getActiveSpan

Conversation

@mydea

@mydea mydea commented Aug 10, 2026

Copy link
Copy Markdown
Member

Use this API instead of a stack-specific one.

@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 3b4dd9c. Configure here.

}

const span = _getSpanForScope(currentScope);
const span = getActiveSpan(currentScope);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Feat PR lacks integration tests

Low Severity

Flagged because it was mentioned in the PR review rules file: feat PRs need at least one integration or E2E test. This change switches logs and metrics span lookup to getActiveSpan, which mainly affects Node/OTEL correlation, but the PR adds no test covering that. Existing metrics suites already emit inside startSpan without asserting span_id / sentry.trace.parent_span_id.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 3b4dd9c. Configure here.

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 30.35 kB - -
@sentry/browser - with treeshaking flags 28.52 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.85 kB - -
@sentry/browser (incl. Tracing) 48.61 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.63 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Profiling) 53.47 kB +0.01% +3 B 🔺
@sentry/browser (incl. Tracing, Replay) 88.05 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.46 kB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 92.77 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 105.46 kB +0.01% +3 B 🔺
@sentry/browser (incl. Feedback) 47.69 kB - -
@sentry/browser (incl. sendFeedback) 35.18 kB - -
@sentry/browser (incl. FeedbackAsync) 40.33 kB - -
@sentry/browser (incl. Metrics) 31.41 kB -0.04% -11 B 🔽
@sentry/browser (incl. Logs) 31.66 kB +0.01% +2 B 🔺
@sentry/browser (incl. Metrics & Logs) 32.35 kB +0.03% +8 B 🔺
@sentry/react 32.14 kB - -
@sentry/react (incl. Tracing) 50.82 kB +0.01% +1 B 🔺
@sentry/vue 35.45 kB +0.02% +5 B 🔺
@sentry/vue (incl. Tracing) 50.59 kB +0.01% +4 B 🔺
@sentry/svelte 30.38 kB - -
CDN Bundle 31.61 kB +0.01% +1 B 🔺
CDN Bundle (incl. Tracing) 48.92 kB +0.01% +3 B 🔺
CDN Bundle (incl. Logs, Metrics) 33.85 kB +0.02% +4 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 50.89 kB +0.02% +7 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 74.38 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing, Replay) 86.5 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.4 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 92.21 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.19 kB +0.01% +5 B 🔺
CDN Bundle - uncompressed 93.95 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 146.93 kB +0.01% +5 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.42 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.78 kB +0.01% +5 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.35 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.18 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.02 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.88 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.71 kB +0.01% +5 B 🔺
@sentry/nextjs (client) 53.38 kB +0.01% +4 B 🔺
@sentry/sveltekit (client) 49.03 kB +0.01% +3 B 🔺
@sentry/core/server 65.65 kB +0.01% +3 B 🔺
@sentry/core/browser 51.98 kB +0.01% +2 B 🔺
@sentry/node 118.47 kB +0.02% +15 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 82.58 kB +0.02% +14 B 🔺
@sentry/aws-serverless 91.96 kB +0.02% +17 B 🔺
@sentry/cloudflare (withSentry) - minified 214.7 kB +0.01% +5 B 🔺
@sentry/cloudflare (withSentry) 530.38 kB +0.01% +16 B 🔺

View base workflow run

@mydea
mydea marked this pull request as ready for review August 10, 2026 12:21
@mydea
mydea requested review from logaretm and s1gr1d August 10, 2026 12:21
Base automatically changed from fn/getActiveSpan-scope to develop August 11, 2026 07:11
@mydea
mydea requested a review from a team as a code owner August 11, 2026 07:11
@mydea
mydea requested review from JPeer264 and andreiborza and removed request for a team August 11, 2026 07:11
@mydea
mydea force-pushed the fn/use-getActiveSpan branch from 3b4dd9c to 4b7aa6b Compare August 11, 2026 07:12
@mydea
mydea merged commit f644353 into develop Aug 11, 2026
273 checks passed
@mydea
mydea deleted the fn/use-getActiveSpan branch August 11, 2026 07:29
JPeer264 pushed a commit that referenced this pull request Aug 12, 2026
…gs & metrics (#23223)

Use this API instead of a stack-specific one.
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.

3 participants