sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Lots of way too long (tens of hours) replays

Open alimony opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [x] I have reviewed the documentation https://docs.sentry.io/
  • [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

8.25.0

Framework Version

Next 14.2.12

Link to Sentry event

[redacted]

Reproduction Example/SDK Setup

Sentry.init({
  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  release: process.env.NEXT_PUBLIC_SENTRY_RELEASE,
  environment: djangoEnv,
  tracesSampleRate: 1.0,
  replaysOnErrorSampleRate: 1.0,
  replaysSessionSampleRate: 1.0,
  tracePropagationTargets: djangoBackendUrls,
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.replayIntegration({
      maskAllText: false,
      blockAllMedia: false,
      maskAllInputs: false,
      networkDetailAllowUrls: djangoBackendUrls,
    }),
  ],
  beforeSend: (event, hint) => {
    console.error(hint.originalException ?? hint.syntheticException);

    if (process.env.NEXT_PUBLIC_SENTRY_DSN) {
      return event;
    } else {
      // drop the event
      return null;
    }
  },
  beforeBreadcrumb: (breadcrumb, hint) => excludeGraphQLFetch(breadcrumb, hint),
});

Steps to Reproduce

We just see these come in all the time. This is a list of replays logged in the last seven days, ordered by duration. As you can see, some are almost 100 hours long:

Image

Also, the replays themselves just show our loading screen for the entire replay.

Expected Result

All replays should be under an hour, and show normal activity.

Actual Result

See above.

alimony avatar Sep 24 '24 22:09 alimony

Hi, thanks for reporting! we'll take a look

Lms24 avatar Sep 26 '24 07:09 Lms24

Just noting here that I'm upgrading to 8.33.x today and will report back whether https://github.com/getsentry/sentry-javascript/pull/13815 seems to fix the issue or not.

alimony avatar Oct 04 '24 15:10 alimony

@alimony It's unlikely to fix your issue, i believe the actual problem is https://github.com/getsentry/sentry-javascript/issues/13872

billyvg avatar Oct 04 '24 16:10 billyvg

@alimony Can you upgrade to 8.34.0 and see if this fixes your issue?

billyvg avatar Oct 17 '24 20:10 billyvg

@billyvg I upgraded to 8.34.0 right at release, and I'm still seeing a few of these (three times in the past few days, one 1+ hour replay, one 2+ hours, and one 4+ hours). My sense is that it's fewer of them, and not the extremely long ones, but seems to be not 100% solved yet. I will monitor more.

alimony avatar Oct 17 '24 21:10 alimony

@alimony thanks for the update! I just checked on your replay list and it seems there are only 4 replays left that exceed one hour in the last week – and it always seems to follow the same pattern that the replayId seems to be connected to a backend error that happened much later. We'll see if there is anything else we can find, please let us know if the issue persists in the upcoming days.

chargome avatar Oct 21 '24 11:10 chargome

@chargome Looks like this is still happening because https://github.com/getsentry/sentry-javascript/pull/13893 only removed from DSC when replay is stopped by calling replay.stop(). There is still the case where replay should be expired, but an event hasn't happened to trigger it's expiry, and when it does happen, we simply return the event instead of resetting replay_id on DSC.

billyvg avatar Nov 13 '24 18:11 billyvg

@alimony Can you update the SDK to the latest and see if this improves?

billyvg avatar Dec 05 '24 16:12 billyvg

This should be fixed now, please open a new issue if you're still having problems!

billyvg avatar Dec 10 '24 16:12 billyvg