Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ANR detection for main process #753

Merged
merged 9 commits into from Oct 5, 2023
Merged

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Sep 28, 2023

Ref #729

This PR adds ANR detection for the Electron main process:

import { init, enableAnrDetection } from '@sentry/electron';
 
init({ dsn: "__DSN__" });
 
// Electron v28+ with ESM
await enableAnrDetection({ mainProcess: { captureStackTrace: true }});
runApp();

// with CJS
enableAnrDetection({ mainProcess: { captureStackTrace: true }}).then(() => {
   runApp();
});

Should we keep the main/renderer config separate like this?

@timfish timfish marked this pull request as ready for review October 5, 2023 11:18
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

src/main/anr.ts Outdated Show resolved Hide resolved
@timfish timfish enabled auto-merge (squash) October 5, 2023 14:13
@timfish timfish merged commit 871d57f into getsentry:master Oct 5, 2023
41 checks passed
@timfish timfish deleted the feat/anr branch October 5, 2023 14:17
@AlbertInRC
Copy link

Hi @tim @AbhiPrasad , will the ANR events impact the Crash Free Session rate?

@timfish
Copy link
Collaborator Author

timfish commented Oct 10, 2023

will the ANR events impact the Crash Free Session rate?

No, not currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants