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

Sudden spike in the number of sessions per user in newer version of electron sdk

Open gid-sentry opened this issue 1 year ago • 9 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)

Electron SDK Version

4.22.0

Electron Version

27.2.0

What platform are you using?

None

Link to Sentry event

https://jupiter-ct.sentry.io/releases/desktop%4024.2.15%2BRCAppDesktop/?chart=sessionCount&issuesType=unhandled&pageEnd=2024-04-19T11%3A00%3A00&pageStart=2024-04-14T23%3A29%3A35&project=1430058

Steps to Reproduce

Update to sdk version 4.22.0, have max Minidumps per session set to 8.

Expected Result

Same rough number of sessions to users

Actual Result

Significantly more sessions per user

gid-sentry avatar Apr 26 '24 06:04 gid-sentry

Does not look like version 4.24 has updates that would affect this functionality as it seems like dependency updates for the javascript sdk + some replay related fixes.

gid-sentry avatar Apr 26 '24 06:04 gid-sentry

Internal Case Doc: https://www.notion.so/sentry/096c7ce2987a4e598ca234c82a222853?v=693bea0c95b54382bb9523ab05711127&p=98b0d84eada9433fa8d313b613e9324c&pm=s

gid-sentry avatar Apr 26 '24 06:04 gid-sentry

Maybe you could check how the sessions were uploaded from a minimum group of users.

AlbertInRC avatar Apr 28 '24 01:04 AlbertInRC

hi @timfish fyi the init looks something like this, would you mind having a look if anything is suspicious here, I am not familiar with this feature, or why there are 2 variants of minidump 😅

import * as Sentry from "@sentry/electron";

Sentry.init({
  dsn: SENTRY_DSN,
  ….
  integrations: [
    new Sentry.Integrations.MainProcessSession({ sendOnCreate: true }),
    new Sentry.Integrations.ElectronMinidump()
  ],
 …..
});

smeubank avatar Apr 29 '24 08:04 smeubank

That init code looks fine. The ElectronMinidump integrations uses Electrons built in native uploader. It's potentially more reliable but lacks the ability to include full context like our custom uploader in the SentryMinidump integration.

Above, both 4.24 and 4.22.0 are mentioned. Which version worked ok and which version started to cause the issue?

timfish avatar Apr 29 '24 09:04 timfish

After integrating the new Sentry SDK 4.22.0 with the following feature, the Crash Free Sessions rate becomes a lot better than before: [*](https://github.com/getsentry/sentry-electron/issues/830)

  • generate maximum 10 sentry errors for a single session by default

We find that a minimum # of users will create lots of sessions.  It blocks our sign off for a new release.  Could you pls help us understand why?  Is it because of a single user upload too many sessions?

I think the mention of 4.24 is red herring, when they moved to 4.22 the issue started, and it appears there is no benefit from 4.24

smeubank avatar Apr 29 '24 10:04 smeubank

Assuming they were on 4.21.0 before...

The Electron SDK 4.21.0 to 4.22.0 diff is minimal: https://github.com/getsentry/sentry-electron/compare/4.21.0...4.22.0

The JavaScript SDK changes from v7.107.0 to v7.109.0 were more extensive but I'm not aware of any changes to sessions: https://github.com/getsentry/sentry-javascript/compare/7.107.0...7.109.0

timfish avatar Apr 29 '24 11:04 timfish

Did they end up reverting to the previous version or are they still seeing excessive sessions?

timfish avatar May 08 '24 12:05 timfish

When this issue closes, 5.4.0 will be published to npm. This has a fix for multiple sessions being recorded when there are multiple renderer crashes in a single session. Let us know if this fixes this issue!

timfish avatar Aug 27 '24 10:08 timfish