Skip to content

fix(node): Avoid creating breadcrumbs for suppressed requests #16285

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025

Conversation

mydea
Copy link
Member

@mydea mydea commented May 14, 2025

It was noticed that we were creating breadcrumbs for sentry-internal requests, which is not desired. This was introduced by us moving breadcrumb generation out of the base http/fetch instrumentation into our own, where we did not look at suppressTracing. Now, when tracing is suppressed, no fetch/http breadcrumbs will be created.

@mydea mydea requested review from Lms24, AbhiPrasad and andreiborza May 14, 2025 07:34
@mydea mydea self-assigned this May 14, 2025
@mydea mydea force-pushed the fn/fix-ignore-sentry-breadcrumbs branch from ce2822d to 756a5aa Compare May 14, 2025 07:36
Copy link
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.96 kB - -
@sentry/browser - with treeshaking flags 23.62 kB - -
@sentry/browser (incl. Tracing) 38.21 kB - -
@sentry/browser (incl. Tracing, Replay) 76.32 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.35 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 81.09 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 93.18 kB - -
@sentry/browser (incl. Feedback) 40.76 kB - -
@sentry/browser (incl. sendFeedback) 28.7 kB - -
@sentry/browser (incl. FeedbackAsync) 33.58 kB - -
@sentry/react 25.77 kB - -
@sentry/react (incl. Tracing) 40.21 kB - -
@sentry/vue 28.34 kB - -
@sentry/vue (incl. Tracing) 40 kB - -
@sentry/svelte 23.99 kB - -
CDN Bundle 25.17 kB - -
CDN Bundle (incl. Tracing) 38.23 kB - -
CDN Bundle (incl. Tracing, Replay) 74.11 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 79.54 kB - -
CDN Bundle - uncompressed 73.44 kB - -
CDN Bundle (incl. Tracing) - uncompressed 113.15 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 227.11 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 239.93 kB - -
@sentry/nextjs (client) 41.86 kB - -
@sentry/sveltekit (client) 38.68 kB - -
@sentry/node 158.02 kB +0.02% +23 B 🔺
@sentry/node - without tracing 97.92 kB +0.03% +28 B 🔺
@sentry/aws-serverless 123.27 kB +0.02% +24 B 🔺

View base workflow run

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Sorry for the naive question but I don't see the immediate connection between breadcrumb generation and tracing being suppressed. As in, breadcrumbs are not part of a trace but "their own" thing and they happen to get attached to transaction payloads (as well as errors). or IOW: Why should suppressTracing control breadcrumb creation behaviour? Fwiw, we expose beforeAddBreadcrumb to filter out breadcrumbs users don't want.

Btw, agree that we shouldn't create breadcrumbs for Sentry requests :)

@mydea
Copy link
Member Author

mydea commented May 14, 2025

Yeah, this is a valid question :) This basically matches the behavior we originally had, and means that we do not need some heuristic to detect our own API requests anymore, we can just rely on this. It also means that e.g. other analytics/otel requests that users may wrap with suppressTracing will also not get breadcrumbs, which also seems OK to me 🤔 Overall, I think it is generally OK/desireable to not have these requests as breadcrumbs...?

Alternatively, we need to re-add some way to identify our own API requests and only filter out these, which is also doable of course :)

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Sorry for the late reply!

I still think it's not "clean" to also include breadcrumbs here but it's pragmatic and what we need as well as what probably the majority of users want. So it's probably one of these "let's roll with it until we or other people complain" changes :D


Some thoughts on alternatives (for when we reach the complaint point):

  1. Make breadcrumb collection toggleable via an option
  2. Create a more generalized Sentry.suppress (naming tbd) API where you can granularly toggle individual telemetry signals.

@mydea mydea merged commit 2054753 into develop May 20, 2025
110 checks passed
@mydea mydea deleted the fn/fix-ignore-sentry-breadcrumbs branch May 20, 2025 10:04
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