Skip to content

Avoid creating http.client spans when performance is disabled #12984

Closed
@mydea

Description

@mydea

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

No response

Link to Sentry event

No response

SDK Setup/Reproduction Example

Sentry.init({
      dsn: 'dsn goes here',
      skipOpenTelemetrySetup: true,
});

Steps to Reproduce

See #12969

  • Do not enable tracing
  • We still register node-fetch & http otel instrumentation which emits spans
  • If you have a manual OTEL setup it will pickup these spans

Expected Result

For node fetch, we should just skip creating any spans if tracing is disabled. node-fetch is special because it uses diagnostics channel, which can be double-registered, so you may get multiple spans.

For http, this is harder because we cannot double-instrument http, so this will conflict anyhow if users also add http-instrumentation themselves. We'll need to educate users that they have to configure our http integration if they want to do that with a custom otel setup, somehow...

Actual Result

When registering node-fetch instrumentation manually, it will double-instrument fetch and create multiple spans.
When registering http instrumentation manually, it may overwrite our http-instrumentation which we depend on, and which will lead to scope leaking etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nodeIssues related to the Sentry Node SDK

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions