Skip to content

feat(node): Do not add HTTP & fetch span instrumentation if tracing is disabled #15730

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 21, 2025

Conversation

mydea
Copy link
Member

@mydea mydea commented Mar 19, 2025

Part of #15725, this PR stops adding the HttpInstrumentation / UndiciInstrumentation if tracing is not enabled.

I think this should not really be breaking, as the integrations should not do anything else, if tracing is disabled 🤔

This only skips the http instrumentation without spans on node 22+, as only there our own diagnostics-channel based instrumentation can cover everything we need.

mydea added a commit that referenced this pull request Mar 19, 2025
…ntation (#15732)

Part of #15730

Noticed that this is not really happening otherwise, so if we are not
adding the `HttpInstrumentation` we now make sure to extract incoming
traces ourselves! This will unlock us not adding that instrumentation
when tracing is disabled.

Also includes #15731
as a side effect.
mydea added a commit that referenced this pull request Mar 19, 2025
This is another stab at #15233, which was reverted here: #15354, with a different implementation.  It is required to make #15730 work.
chargome pushed a commit that referenced this pull request Mar 19, 2025
This is another stab at #15233, which was reverted here: #15354, with a different implementation.  It is required to make #15730 work.
@mydea mydea force-pushed the fn/skip-http-spans-without-performance branch from 259f829 to 34f5b2a Compare May 20, 2025 12:40
Copy link
Contributor

github-actions bot commented May 20, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.95 kB - -
@sentry/browser - with treeshaking flags 23.71 kB - -
@sentry/browser (incl. Tracing) 38.36 kB - -
@sentry/browser (incl. Tracing, Replay) 76.47 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.58 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 81.25 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 93.35 kB - -
@sentry/browser (incl. Feedback) 40.72 kB - -
@sentry/browser (incl. sendFeedback) 28.67 kB - -
@sentry/browser (incl. FeedbackAsync) 33.56 kB - -
@sentry/react 25.73 kB - -
@sentry/react (incl. Tracing) 40.34 kB - -
@sentry/vue 28.34 kB - -
@sentry/vue (incl. Tracing) 40.19 kB - -
@sentry/svelte 23.97 kB - -
CDN Bundle 25.23 kB - -
CDN Bundle (incl. Tracing) 38.52 kB - -
CDN Bundle (incl. Tracing, Replay) 74.3 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 79.75 kB - -
CDN Bundle - uncompressed 73.63 kB - -
CDN Bundle (incl. Tracing) - uncompressed 114.03 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 228 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 240.82 kB - -
@sentry/nextjs (client) 41.99 kB - -
@sentry/sveltekit (client) 38.84 kB - -
@sentry/node 149.5 kB +0.03% +38 B 🔺
@sentry/node - without tracing 98.12 kB +0.02% +18 B 🔺
@sentry/aws-serverless 123.46 kB +0.03% +27 B 🔺

View base workflow run

@mydea mydea force-pushed the fn/skip-http-spans-without-performance branch from 34f5b2a to f6f52ff Compare May 20, 2025 13:27
@mydea mydea requested review from Lms24 and chargome May 20, 2025 13:27
@mydea mydea marked this pull request as ready for review May 20, 2025 13:27
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

LGTM!

@mydea mydea merged commit b4bd21f into develop May 21, 2025
114 checks passed
@mydea mydea deleted the fn/skip-http-spans-without-performance branch May 21, 2025 14:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants