Skip to content

Commit ee9a9d6

Browse files
authored
feat(v8/node): Remove deprecated anr methods (#10562)
Removes all references to `enableAnrDetection` and the `Anr` integration. Moves us toward #8844 in the node side.
1 parent d024a76 commit ee9a9d6

File tree

17 files changed

+15
-105
lines changed

17 files changed

+15
-105
lines changed

MIGRATION.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ enum. If you were using the `Severity` enum, you should replace it with the `Sev
2727
The `Offline` integration has been removed in favor of the offline transport wrapper:
2828
http://docs.sentry.io/platforms/javascript/configuration/transports/#offline-caching
2929

30+
## Removal of `enableAnrDetection` and `Anr` class (##10562)
31+
32+
The `enableAnrDetection` and `Anr` class have been removed. See the
33+
[docs](https://docs.sentry.io/platforms/node/configuration/application-not-responding/) for more details how to migrate
34+
to `anrIntegration`, the new integration for ANR detection.
35+
3036
## Other changes
3137

3238
- Remove `spanStatusfromHttpCode` in favour of `getSpanStatusFromHttpCode` (#10361)

dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const DEPENDENTS: Dependent[] = [
6060
{
6161
package: '@sentry/serverless',
6262
exports: Object.keys(SentryServerless),
63-
ignoreExports: ['cron', 'hapiErrorPlugin', 'enableAnrDetection'],
63+
ignoreExports: ['cron', 'hapiErrorPlugin'],
6464
},
6565
{
6666
package: '@sentry/sveltekit',

dev-packages/node-integration-tests/suites/anr/basic-session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Sentry.init({
1111
dsn: 'https://[email protected]/1337',
1212
release: '1.0',
1313
debug: true,
14-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 100 })],
14+
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
1515
});
1616

1717
function longWork() {

dev-packages/node-integration-tests/suites/anr/basic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Sentry.init({
1212
release: '1.0',
1313
debug: true,
1414
autoSessionTracking: false,
15-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 100 })],
15+
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
1616
});
1717

1818
function longWork() {

dev-packages/node-integration-tests/suites/anr/basic.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Sentry.init({
1212
release: '1.0',
1313
debug: true,
1414
autoSessionTracking: false,
15-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 100 })],
15+
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
1616
});
1717

1818
function longWork() {

dev-packages/node-integration-tests/suites/anr/forked.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Sentry.init({
1212
release: '1.0',
1313
debug: true,
1414
autoSessionTracking: false,
15-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 100 })],
15+
integrations: [Sentry.anrIntegration({ captureStackTrace: true, anrThreshold: 100 })],
1616
});
1717

1818
function longWork() {

dev-packages/node-integration-tests/suites/anr/legacy.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

dev-packages/node-integration-tests/suites/anr/should-exit-forced.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function configureSentry() {
66
release: '1.0',
77
debug: true,
88
autoSessionTracking: false,
9-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true })],
9+
integrations: [Sentry.anrIntegration({ captureStackTrace: true })],
1010
});
1111
}
1212

dev-packages/node-integration-tests/suites/anr/should-exit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function configureSentry() {
66
release: '1.0',
77
debug: true,
88
autoSessionTracking: false,
9-
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true })],
9+
integrations: [Sentry.anrIntegration({ captureStackTrace: true })],
1010
});
1111
}
1212

dev-packages/node-integration-tests/suites/anr/test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ conditionalTest({ min: 16 })('should report ANR when event loop blocked', () =>
5656
cleanupChildProcesses();
5757
});
5858

59-
// TODO (v8): Remove this old API and this test
60-
test('Legacy API', done => {
61-
createRunner(__dirname, 'legacy.js').expect({ event: EXPECTED_ANR_EVENT }).start(done);
62-
});
63-
6459
test('CJS', done => {
6560
createRunner(__dirname, 'basic.js').expect({ event: EXPECTED_ANR_EVENT }).start(done);
6661
});

0 commit comments

Comments
 (0)