-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- 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/node
SDK Version
7.72.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Sentry.init({
dsn: process.env.SENTRY_DSN,
release: getSentryReleaseIdentifier(),
environment: process.env.SITE_NAME?.toLowerCase() || undefined,
initialScope: {
tags: { commit: version?.commitSha },
},
});
Steps to Reproduce
-
Enable the new Application Not Responding feature:
await Sentry.enableAnrDetection({ captureStackTrace: true });
-
Configure the application to run within PM2.
Expected Result
The application works.
Actual Result
Sentry's ANR feature thinks that the application is the ANR watchdog child (because the process has been forked by PM2 and therefore has a process.send
), so it doesn't work. (In my local testing, it causes PM2 to treat the process as terminated by SIGINT.)
I could provide a separate entryScript
, but that wouldn't help the issue of the parent process thinking it's the child. I think I could delete process.send
, but that seems like a hack (and can break PM2 features). Maybe enableAnrDetection
needs some sort of "force" parameter? Maybe it should assume it's the parent (ignoring process.send
) if an entryScript
is provided and/or if entryScript !== process.arg[1]
?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status