Skip to content
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

fix(node): Ensure ignoreOutgoingRequests of httpIntegration applies to breadcrumbs #13970

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Oct 14, 2024

This PR fixes a bug, initially reported in Discord, which caused the httpIntegration's ignoreOutgoingRequests option to not be applied to breadcrumb creation for outgoing requests. The result was that despite spans being correctly filtered by the option, breadcrumbs would still be created which contradicts the function'S JSDoc and our docs.

It seems like this was already a bug prior to #13763. However, the behaviour seems to have been carried over to #13763.

This PR fixes the bug by:

  • correctly passing in ignoreOutgoingRequests to SentryHttpIntegration (same signature as httpIntegration)
  • reconstructing the url and request parameter like in the OpenTelemetry instrumentation
  • adding/adjusting a regression test so that we properly test agains ignoreOutgoingRequests with both params. Now not just for filtered spans but also for breadcrumbs.

Copy link
Contributor

github-actions bot commented Oct 14, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.73 KB - -
@sentry/browser - with treeshaking flags 21.53 KB - -
@sentry/browser (incl. Tracing) 35.01 KB - -
@sentry/browser (incl. Tracing, Replay) 71.68 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.07 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 76.01 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 88.78 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback, metrics) 90.63 KB - -
@sentry/browser (incl. metrics) 27 KB - -
@sentry/browser (incl. Feedback) 39.87 KB - -
@sentry/browser (incl. sendFeedback) 27.38 KB - -
@sentry/browser (incl. FeedbackAsync) 32.17 KB - -
@sentry/react 25.49 KB - -
@sentry/react (incl. Tracing) 37.97 KB - -
@sentry/vue 26.91 KB - -
@sentry/vue (incl. Tracing) 36.9 KB - -
@sentry/svelte 22.87 KB - -
CDN Bundle 24.11 KB - -
CDN Bundle (incl. Tracing) 36.84 KB - -
CDN Bundle (incl. Tracing, Replay) 71.47 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 76.78 KB - -
CDN Bundle - uncompressed 70.7 KB - -
CDN Bundle (incl. Tracing) - uncompressed 109.36 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 221.72 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 234.94 KB - -
@sentry/nextjs (client) 37.94 KB - -
@sentry/sveltekit (client) 35.6 KB - -
@sentry/node 125.02 KB +0.1% +120 B 🔺
@sentry/node - without tracing 94.25 KB +0.14% +126 B 🔺
@sentry/aws-serverless 103.81 KB +0.11% +110 B 🔺

View base workflow run

@Lms24 Lms24 changed the title fix(node): Ensure ignoreOutgoingRequests applies to breadcrumbs fix(node): Ensure ignoreOutgoingRequests of httpIntegration applies to breadcrumbs Oct 14, 2024
@Lms24 Lms24 self-assigned this Oct 14, 2024
@Lms24 Lms24 marked this pull request as ready for review October 14, 2024 11:03
Comment on lines +48 to +49
* Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.
* Spans will be non recording if tracing is disabled.
Copy link
Member Author

@Lms24 Lms24 Oct 14, 2024

Choose a reason for hiding this comment

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

I also adjusted the JSDoc of ignoreIncomingRequests because it wrongfully claimed that incoming requests also generate breadcrumbs. Which isn't the case now and wasn't the case before:

// Only generate breadcrumbs for outgoing requests
if (!_isClientRequest(request)) {
return;
}

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

Ah, thanks, great catch, that makes sense 🚀

@Lms24 Lms24 merged commit 41515a6 into develop Oct 16, 2024
133 checks passed
@Lms24 Lms24 deleted the lms/test-http-ignoreOutgoingRequests branch October 16, 2024 08: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