ConstThe ANR integration has been deprecated. Use eventLoopBlockIntegration from @sentry/node-native instead.
Detects when the Node.js main thread event loop is blocked for more than the configured threshold (5 seconds by default) and reports these as Sentry events.
ANR detection uses a worker thread to monitor the event loop in the main app thread. The main app thread sends a heartbeat message to the ANR worker thread every 50ms by default. If the ANR worker does not receive a heartbeat message for the configured threshold duration, it triggers an ANR event.
Overhead should be minimal:
Sentry.init({
dsn: "https://[email protected]/0",
integrations: [
Sentry.anrIntegration({
anrThreshold: 5000,
captureStackTrace: true,
pollInterval: 50,
}),
],
});
Application Not Responding (ANR) integration for Node.js applications.