getsentry / sentry-electron

The official Sentry SDK for Electron
https://sentry.io/
MIT License
224 stars 58 forks source link

Improve minidump Integrations (SentryMinidump, ElectronMinidump) #1009

Open kpujjigit opened 1 day ago

kpujjigit commented 1 day ago

Problem Statement

The SentryMinidump integration can invoke beforeSend or ignoreErrors at the time of crash, but can't send Main thread mindumps until the crashed application is restored, meaning users who do not restart their app will not send a minidump (Link). ElectronMinidump can send Main thread minidumps right away, but can't invoke beforeSend or ignoreErrors at the time of the crash.

Solution Brainstorm

Currently there isn't a way to both a) capture Main thread minidumps and send right away, AND b) allow callback methods to be invoked before sending to Sentry. Allowing one or both Mindiump integrations for Electron would ensure crashes are sent to Sentry while being subject to callback methods.

timfish commented 1 day ago

The sentryMinidumpIntegration works by disabling server upload in Electrons crashReporter. The crashReporter then leaves us to manage the minidump files in a directory.

The electronMinidumpIntegration leaves the crashReporter with server upload enabled and Electrons native crash reporter manages the files. They are often not on disk long enough to be read from JavaScript.

These two modes can't be used together because they both rely of having complete control of the generated minidumps files.