Skip to content

Attach stack trace to events from HTTPClient integration so they are not merged (fingerprinted) into a single issue #8353

Closed
@harry-gocity

Description

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.53.1

Framework Version

React 17.0.2, Next.js 12.1.6

Link to Sentry event

https://go-city.sentry.io/issues/4231630878/?project=4503958434480128

SDK Setup

const { publicRuntimeConfig } = getConfig();

const isProduction = process.env.NODE_ENV === 'production';

Sentry.init({
    // when dsn is null, no errors will be sent to Sentry
    dsn: isProduction ? publicRuntimeConfig.SENTRY_DSN : null,
    environment: publicRuntimeConfig.ENVIRONMENT ?? 'local',
    release: isProduction ? publicRuntimeConfig.SENTRY_RELEASE : `development-${publicRuntimeConfig.USER}`,
    ignoreErrors: ['jQuery'],
    allowUrls: isProduction
        ? [
              // Match our app 
              /https://our-site-here.com/,
              // Match gtm error
              /gtm.js/,
          ]
        : [],
    tracesSampler,
    beforeSend: (event: Event): Event => {
        // append LogRocket Session url to Sentry extras, for easier debugging
        const logRocketSession = LogRocket.sessionURL;
        if (logRocketSession !== null) {
            event.extra['LogRocket'] = logRocketSession;
        }
        return event;
    },
    integrations: [
        new HttpClient(),
    ],
});

Steps to Reproduce

We added the HTTP Client Integration to our Sentry setup:

    integrations: [
        new HttpClient(),
    ],

After this, we started to see events being tracked in Sentry for 500, 502 and 504 status codes in responses from our site.

Expected Result

We would be able to triage requests to different URLS separately. Sentry would group HTTPClient-captured events as separate issues. We thought that would happen by default using the request url and response status code.

Actual Result

All the events are grouped under the same Sentry issue, regardless of the error code or request URL.

For the issue linked above:

image

Under the 'all events' tab there several different issues all being grouped together (URLs cropped intentionally):

image

AFAIK we have not accidentally merged any issues manually.

image

Metadata

Assignees

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions