-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
size-limit report 📦
|
ignoreOutgoingRequests
applies to breadcrumbsignoreOutgoingRequests
of httpIntegration
applies to breadcrumbs
* 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. |
There was a problem hiding this comment.
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:
sentry-javascript/packages/node/src/integrations/http.ts
Lines 245 to 248 in d7749ae
// Only generate breadcrumbs for outgoing requests | |
if (!_isClientRequest(request)) { | |
return; | |
} |
There was a problem hiding this 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 🚀
…es to breadcrumbs (#13970) Fix a bug which caused the `httpIntegration`'s `ignoreOutgoingRequests` option to not be applied to breadcrumb creation for outgoing requests. As a result, despite spans being correctly filtered by the option, breadcrumbs would still be created which contradicts the function'S JSDoc and [our docs](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/http/#ignoreoutgoingrequests). This patch 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](https://github.com/open-telemetry/opentelemetry-js/blob/7293e69c1e55ca62e15d0724d22605e61bd58952/experimental/packages/opentelemetry-instrumentation-http/src/http.ts#L756-L789) - 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.
…es to breadcrumbs (#13970) Fix a bug which caused the `httpIntegration`'s `ignoreOutgoingRequests` option to not be applied to breadcrumb creation for outgoing requests. As a result, despite spans being correctly filtered by the option, breadcrumbs would still be created which contradicts the function'S JSDoc and [our docs](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/http/#ignoreoutgoingrequests). This patch 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](https://github.com/open-telemetry/opentelemetry-js/blob/7293e69c1e55ca62e15d0724d22605e61bd58952/experimental/packages/opentelemetry-instrumentation-http/src/http.ts#L756-L789) - 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.
This PR fixes a bug, initially reported in Discord, which caused the
httpIntegration
'signoreOutgoingRequests
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:
ignoreOutgoingRequests
toSentryHttpIntegration
(same signature ashttpIntegration
)url
andrequest
parameter like in the OpenTelemetry instrumentationignoreOutgoingRequests
with both params. Now not just for filtered spans but also for breadcrumbs.