Skip to content

Commit f1bae22

Browse files
Deprecate ANR integration in favor of eventLoopBlockIntegration
Co-authored-by: aprasad <[email protected]>
1 parent fa6138b commit f1bae22

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/node/src/integrations/anr/common.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import type { Contexts, DsnComponents, Primitive, SdkMetadata } from '@sentry/core';
22

3+
/**
4+
* @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
5+
*/
36
export interface AnrIntegrationOptions {
47
/**
58
* Interval to send heartbeat messages to the ANR worker.
@@ -39,6 +42,9 @@ export interface AnrIntegrationOptions {
3942
appRootPath: string | undefined;
4043
}
4144

45+
/**
46+
* @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
47+
*/
4248
export interface WorkerStartData extends AnrIntegrationOptions {
4349
debug: boolean;
4450
sdkMetadata: SdkMetadata;

packages/node/src/integrations/anr/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ import type { AnrIntegrationOptions, WorkerStartData } from './common';
1919

2020
const { isPromise } = types;
2121

22+
/**
23+
* @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
24+
*/
2225
// This string is a placeholder that gets overwritten with the worker code.
2326
export const base64WorkerScript = '###AnrWorkerScript###';
2427

@@ -116,6 +119,9 @@ const _anrIntegration = ((options: Partial<AnrIntegrationOptions> = {}) => {
116119

117120
type AnrReturn = (options?: Partial<AnrIntegrationOptions>) => Integration & AnrInternal;
118121

122+
/**
123+
* @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
124+
*/
119125
export const anrIntegration = defineIntegration(_anrIntegration) as AnrReturn;
120126

121127
/**
@@ -230,6 +236,7 @@ export function disableAnrDetectionForCallback<T>(callback: () => T): T;
230236
export function disableAnrDetectionForCallback<T>(callback: () => Promise<T>): Promise<T>;
231237
/**
232238
* Disables ANR detection for the duration of the callback
239+
* @deprecated The ANR integration has been deprecated. Use `eventLoopBlockIntegration` from `@sentry/node-native` instead.
233240
*/
234241
export function disableAnrDetectionForCallback<T>(callback: () => T | Promise<T>): T | Promise<T> {
235242
const integration = getClient()?.getIntegrationByName(INTEGRATION_NAME) as AnrInternal | undefined;

0 commit comments

Comments
 (0)