Skip to content

Disable createSpanUrlMap #7060

@jeengbe

Description

@jeengbe

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/node

SDK Version

7.31.1

Framework Version

n/a

Link to Sentry event

n/a

SDK Setup

Sentry.init({
  ...
  integrations: [
    new Sentry.Integrations.Http({
      tracing: {
        shouldCreateSpanForRequest: url => !url.includes('newrelic.com'),
      },
    }),
  ],
});

Steps to Reproduce

See Actual Result

Expected Result

See Actual Result

Actual Result

In https://github.com/getsentry/sentry-javascript/blob/develop/packages/node/src/integrations/http.ts#L141-L156, shouldCreateSpanForRequest requests are cached in a map. This is intended behaviour with good thought, but a way to disable this would be good.

In our application, we are making a lot of network requests to a variety of different URLs that contain a many distinct combinations of many IDs. Over time, this has led to roughly 250 MB of strings only, stored in that very object.
As caching these lookups is not worth it in our case, an option would be good to disable this behaviour.

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions