Closed vibaiher-qatium closed 1 month ago
Hello thanks for writing in.
Could you please provide a stackblitz or a github repo where we could try this out?
Thank you for your prompt response. I understand the need for a sample project to help investigate the issue. However, creating such a project would be quite time-consuming and resource-intensive for us at the moment.
While trying to understand the code, I arrived at the following points:
It appears that the code is not checking whether tracing is enabled or not. It seems likely that adding a guard clause could resolve the issue.
Is it possible to look into this issue based on the description and details provided? We have outlined the specific problem and steps to reproduce it in detail. If you need any specific logs or further information, I would be happy to provide them.
Thank you for your understanding and assistance.
Understood, thanks for having a closer look. We discussed this internally and we might want to guard these integrations in the future.
For now, we recommend to filter out the node fetch integration in your init call:
const integrations = Sentry.getDefaultIntegrationsWithoutPerformance().filter((integration) => integration.name !== 'NodeFetch')
Sentry.init({
...
integrations,
})
Please let me know if that helps.
Thank you @andreiborza, we will give it a try.
Nope, the workaround does not work :(
@vibaiher-qatium sorry I forgot to mention you need to set defaultIntegrations: false
as well. Does it work with that?
I also created an issue to improve/fix this on our end: https://github.com/getsentry/sentry-javascript/issues/12984
Thank you very much, in the end, the workaround of using the filtered list of integrations and disabling the defaults did work.
A note for the future, once https://github.com/getsentry/sentry-javascript/pull/13003 is released (in the next version of the SDK), this will not be necessary anymore - the node-fetch integration will not create spans anymore than in your scenario!
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.18.0
Framework Version
Express 4.19.2
Link to Sentry event
No response
SDK Setup/Reproduction Example
Steps to Reproduce
node --require @qatium/open-telemetry-express build/api.js
Expected Result
The expected behavior is that @sentry/node does not register the opentelemetry-instrumentation-node-fetch instrumentation if the tracing option is disabled in Sentry's configuration.
Actual Result
Despite having the tracing option disabled in Sentry's configuration, the opentelemetry-instrumentation-node-fetch library is still being registered, causing duplication of Span information when using OpenTelemetry instrumentation for HTTP.