Skip to content

Commit 5cc64fc

Browse files
antonisclaude
andcommitted
feat(android): Expose enableAnrFingerprinting option
Allows React Native users to opt out of the default-on ANR fingerprinting behavior introduced in Android SDK 8.35.0, which groups ANR events with system-only stacktraces into a single issue. Fixes #5837 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 11f4bd9 commit 5cc64fc

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
- Add `expoUpdatesListenerIntegration` that records breadcrumbs for Expo Updates lifecycle events ([#5795](https://github.com/getsentry/sentry-react-native/pull/5795))
1515
- Tracks update checks, downloads, errors, rollbacks, and restarts as `expo.updates` breadcrumbs
1616
- Enabled by default in Expo apps (requires `expo-updates` to be installed)
17-
-
17+
- feat(android): Expose `enableAnrFingerprinting` option ([#5837](https://github.com/getsentry/sentry-react-native/issues/5837))
18+
1819
### Fixes
1920

2021
- Fix native frames measurements being dropped due to race condition ([#5813](https://github.com/getsentry/sentry-react-native/pull/5813))

packages/core/android/src/main/java/io/sentry/react/RNSentryStart.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ static void getSentryAndroidOptions(
151151
if (rnOptions.hasKey("enableTombstone")) {
152152
options.setTombstoneEnabled(rnOptions.getBoolean("enableTombstone"));
153153
}
154+
if (rnOptions.hasKey("enableAnrFingerprinting")) {
155+
options.setEnableAnrFingerprinting(rnOptions.getBoolean("enableAnrFingerprinting"));
156+
}
154157
if (rnOptions.hasKey("spotlight")) {
155158
if (rnOptions.getType("spotlight") == ReadableType.Boolean) {
156159
options.setEnableSpotlight(rnOptions.getBoolean("spotlight"));

packages/core/src/js/options.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,19 @@ export interface BaseReactNativeOptions {
7373
*/
7474
enableNdkScopeSync?: boolean;
7575

76+
/**
77+
* When enabled, ANR events whose stacktraces contain only system frames
78+
* (e.g. `java.lang`, `android.os`) are assigned a static fingerprint and
79+
* grouped into a single issue instead of creating many separate issues.
80+
*
81+
* Enabled by default in the Android SDK since v8.35.0.
82+
* Set to `false` to restore per-stacktrace ANR grouping.
83+
*
84+
* @default true
85+
* @platform android
86+
*/
87+
enableAnrFingerprinting?: boolean;
88+
7689
/**
7790
* When enabled, all the threads are automatically attached to all logged events on Android
7891
*

0 commit comments

Comments
 (0)