-
-
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
Sentry-related spans are appearing in dns/net opentelemetry traces #13466
Comments
Hopefully it's clear that this is behaviour that causes spans to be extra spammy, so we should find a way around this. This is because @opentelemetry/instrumentation-http does not suppress tracing on outgoing ignored requests. It asks for a config flag to suppress tracing on ignored outgoing requests, to prevent this issue. I figure then the Sentry SDK can either let a user pass that as a custom flag to the underlying instrumentation (no change required in sentry SDK) or can simply enable the flag by default (might be considered a breaking change, up to y'all). |
Hi, we are already using |
Hi Luca - could you point me to where this happens in the Sentry SDK? Due to the way instrumentation-http is designed there's no place to suppress tracing that would affect children in the various hooks. |
I have found this: sentry-javascript/packages/node/src/transports/http.ts Lines 82 to 86 in aaaaa7d
Which calls two functions,
and: sentry-javascript/packages/core/src/transports/base.ts Lines 45 to 47 in aaaaa7d
sentry-javascript/packages/core/src/transports/base.ts Lines 108 to 111 in aaaaa7d
Now I think the problem is in how we're trying to I think the reason we haven't noticed this so far is because we ignore sentry requests in the http integration: sentry-javascript/packages/node/src/integrations/http.ts Lines 105 to 107 in aaaaa7d
While that prevents the http spans from being created, it doesn't suppress tracing to catch the dns/net spans (hence the original otel feature request). SO with all that said, if we can fix how we call suppressTracing in the sentry SDK, I agree that the otel feature request wouldn't be required. |
I think you're absolutely right. TBH looking at the code retroactively, I would have probably expected the AsyncContext for trace suppression to be preserved down to the code where we execute, but looking a bit closer it makes sense that it is not suppressed because we call that code from a completely different async context. I opened a PR that should hopefully fix this #13491 |
…an transport creation (#13491) #13466 (comment) correctly points out that we are suppressing tracing for the transport creation instead of the transport execution. This PR wraps the code that is actually conducting the request with `suppressTracing` instead of the transport creation. Fixes #13466
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.26.0
Framework Version
Node 20.12.2
Link to Sentry event
No response
Reproduction Example/SDK Setup
Steps to Reproduce
Expected Result
The trace should NOT have any sentry related spans in it
Actual Result
Despite the @opentelemetry/instrumentation-http ignoring (not creating spans for) the sentry outgoing requests, the dns and net instrumentations still appear in the trace:
The text was updated successfully, but these errors were encountered: