Skip to content

Comments

ref(core): Move shouldPropagateTraceForUrl from opentelemetry to core#19254

Merged
andreiborza merged 2 commits intodevelopfrom
ab/move-shouldPropagateTraceForUrl-to-core
Feb 10, 2026
Merged

ref(core): Move shouldPropagateTraceForUrl from opentelemetry to core#19254
andreiborza merged 2 commits intodevelopfrom
ab/move-shouldPropagateTraceForUrl-to-core

Conversation

@andreiborza
Copy link
Member

@andreiborza andreiborza commented Feb 10, 2026

This function is needed in an upcoming pr by node-core/light, and since node-core/light does not depend on OpenTelemetry we need to move this to core and re-export it in @sentry/opentelemetry for backwards compatibility.

Closes #19255 (added automatically)

This function is needed by light mode integrations that don't use
OpenTelemetry. Move it to @sentry/core and re-export from
@sentry/opentelemetry for backwards compatibility.
Copy link

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

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


const cachedDecision = decisionMap?.get(url);
if (cachedDecision !== undefined) {
!cachedDecision && debug.log(NOT_PROPAGATED_MESSAGE, url);
Copy link

Choose a reason for hiding this comment

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

Missing DEBUG_BUILD guard drops tree-shaking for debug logs

Medium Severity

The original code guarded debug.log calls with DEBUG_BUILD &&, enabling bundlers to tree-shake the entire expression (including NOT_PROPAGATED_MESSAGE) in production builds. The moved version drops the DEBUG_BUILD && prefix. While debug.log internally checks DEBUG_BUILD, the external guard is what allows dead-code elimination of the string constant and function call. Every other debug.log call in packages/core/src consistently uses the DEBUG_BUILD && pattern.

Additional Locations (1)

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Restore the DEBUG_BUILD && prefix that was present in the original
opentelemetry version, enabling bundlers to tree-shake the debug
log calls and string constant in production builds.
@andreiborza andreiborza force-pushed the ab/move-shouldPropagateTraceForUrl-to-core branch from a76acf3 to 970a075 Compare February 10, 2026 15:50
@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

Codecov Results 📊


Generated by Codecov Action

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.56 kB - -
@sentry/browser - with treeshaking flags 24.08 kB - -
@sentry/browser (incl. Tracing) 42.36 kB - -
@sentry/browser (incl. Tracing, Profiling) 47.03 kB - -
@sentry/browser (incl. Tracing, Replay) 81.18 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.8 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 85.87 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 98.03 kB - -
@sentry/browser (incl. Feedback) 42.29 kB - -
@sentry/browser (incl. sendFeedback) 30.23 kB - -
@sentry/browser (incl. FeedbackAsync) 35.22 kB - -
@sentry/browser (incl. Metrics) 26.74 kB - -
@sentry/browser (incl. Logs) 26.88 kB - -
@sentry/browser (incl. Metrics & Logs) 27.56 kB - -
@sentry/react 27.33 kB - -
@sentry/react (incl. Tracing) 44.7 kB - -
@sentry/vue 30.01 kB - -
@sentry/vue (incl. Tracing) 44.21 kB - -
@sentry/svelte 25.58 kB - -
CDN Bundle 28.11 kB - -
CDN Bundle (incl. Tracing) 43.2 kB - -
CDN Bundle (incl. Logs, Metrics) 28.95 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 44.03 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.02 kB - -
CDN Bundle (incl. Tracing, Replay) 80.07 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 80.94 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 85.5 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.4 kB - -
CDN Bundle - uncompressed 82.22 kB - -
CDN Bundle (incl. Tracing) - uncompressed 127.93 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 85.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 130.76 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 208.71 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.81 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 247.63 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 257.61 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 260.42 kB - -
@sentry/nextjs (client) 47.04 kB - -
@sentry/sveltekit (client) 42.81 kB - -
@sentry/node-core 52.17 kB -0.04% -18 B 🔽
@sentry/node 166.53 kB -0.01% -1 B 🔽
@sentry/node - without tracing 93.96 kB -0.01% -7 B 🔽
@sentry/aws-serverless 109.47 kB -0.01% -7 B 🔽

View base workflow run

@github-actions
Copy link
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,849 - 8,604 +3%
GET With Sentry 1,654 19% 1,676 -1%
GET With Sentry (error only) 5,960 67% 6,060 -2%
POST Baseline 1,164 - 1,182 -2%
POST With Sentry 560 48% 576 -3%
POST With Sentry (error only) 1,015 87% 1,051 -3%
MYSQL Baseline 3,216 - 3,180 +1%
MYSQL With Sentry 429 13% 448 -4%
MYSQL With Sentry (error only) 2,618 81% 2,639 -1%

View base workflow run

Copy link
Member

@nicohrubec nicohrubec left a comment

Choose a reason for hiding this comment

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

lgtm

@andreiborza andreiborza merged commit ef9916a into develop Feb 10, 2026
427 of 431 checks passed
@andreiborza andreiborza deleted the ab/move-shouldPropagateTraceForUrl-to-core branch February 10, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ref(core): Move shouldPropagateTraceForUrl from opentelemetry to core

4 participants