Skip to content

feat(android): Expose enableAnrFingerprinting option#5838

Merged
antonis merged 3 commits intomainfrom
feat/android/anr-fingerprinting-option
Mar 19, 2026
Merged

feat(android): Expose enableAnrFingerprinting option#5838
antonis merged 3 commits intomainfrom
feat/android/anr-fingerprinting-option

Conversation

@antonis
Copy link
Contributor

@antonis antonis commented Mar 18, 2026

Fixes #5837

Type of change

  • Bugfix
  • New feature
  • Enhancement (improvement to existing feature or bugfix)
  • Refactoring (no functional changes, no API changes)

Description

Android SDK 8.35.0 introduced enableAnrFingerprinting (default true), which groups ANR events whose stacktraces contain only system frames into a single Sentry issue. Until now there was no way for React Native users to opt out from JavaScript.

This PR exposes the option in the RN SDK:

Sentry.init({
  dsn: '...',
  enableAnrFingerprinting: false, // restore per-stacktrace ANR grouping
});

Changes:

  • Added enableAnrFingerprinting?: boolean to BaseReactNativeOptions in options.ts
  • Reading it in RNSentryStart.java and forwarding to SentryAndroidOptions.setEnableAnrFingerprinting()

Docs PR: getsentry/sentry-docs#17021

Motivation and Context

When users upgrade to the Android SDK 8.35.0+ (via this SDK's bump in #5812), the ANR grouping behavior changes silently. This option lets them opt out if needed.

How did you test it?

  • TypeScript build passes (yarn build)
  • Follows the existing pattern for all other Android-specific options (e.g. enableTombstone, enableNdk)

Checklist

  • No new warnings or errors in build
  • TypeScript types are correct
  • Tests added/updated — unit test for RNSentryStart.java can be added as a follow-up

Next steps

This PR is based on #5812 and should be merged after (or together with) that PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(android): Expose enableAnrFingerprinting option by antonis in #5838
  • fix(tracing): Recover app start data when first navigation transaction is discarded by antonis in #5833
  • chore(deps): update Android SDK to v8.36.0 by github-actions in #5812
  • Add expoUpdatesListenerIntegration that records breadcrumbs for Expo Updates lifecycle events by alwx in #5795
  • chore(deps): update Sentry Android Gradle Plugin to v6.2.0 by github-actions in #5836
  • fix(ci): Update Appium version to fix Sauce Labs metrics tests by antonis in #5835
  • chore(deps): update JavaScript SDK to v10.44.0 by github-actions in #5832
  • fix(tracing): Fix native frames measurements dropped for idle transactions by antonis in #5813
  • feat(core): Support SENTRY_ENVIRONMENT in bare React Native builds by antonis in #5823
  • chore(deps): bump tar to ^7.5.11 by antonis in #5824
  • chore(deps): bump actions/create-github-app-token from 2.2.1 to 3.0.0 by dependabot in #5822
  • chore(deps): bump dorny/paths-filter from 3.0.2 to 4.0.1 by dependabot in #5820
  • chore(deps): bump reactivecircus/android-emulator-runner from 2.35.0 to 2.37.0 by dependabot in #5818
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.23.2 to 2.24.1 by dependabot in #5821
  • chore(deps): bump getsentry/craft from 2.23.2 to 2.24.1 by dependabot in #5819
  • chore(deps): bump undici from 6.23.0 to 6.24.1 by dependabot in #5817
  • chore(deps): bump flatted from 3.3.1 to 3.4.1 by dependabot in #5816
  • Ref: remove yarn from stub update by lucas-zimerman in #5811
  • Ref(CI): Unify stub update with android update by lucas-zimerman in #5807

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 2c26244

@antonis
Copy link
Contributor Author

antonis commented Mar 18, 2026

@sentry review

@antonis
Copy link
Contributor Author

antonis commented Mar 18, 2026

@cursor review

@bruno-garcia bruno-garcia force-pushed the deps/scripts/update-android.sh branch from 40cd37e to 0a10aae Compare March 18, 2026 13:44
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Base automatically changed from deps/scripts/update-android.sh to main March 18, 2026 14:31
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>
@antonis antonis force-pushed the feat/android/anr-fingerprinting-option branch from 6e8f4c1 to 5cc64fc Compare March 18, 2026 14:36
@antonis antonis marked this pull request as ready for review March 18, 2026 15:01
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Mar 19, 2026
Copy link
Contributor

@alwx alwx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and straightforward. Thanks!

@github-actions
Copy link
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 393.89 ms 429.77 ms 35.88 ms
Size 43.75 MiB 48.07 MiB 4.32 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4a17c8f+dirty 406.62 ms 400.58 ms -6.04 ms
df1f7df+dirty 442.64 ms 427.16 ms -15.48 ms
a483f9f+dirty 396.82 ms 453.28 ms 56.46 ms
60cd796+dirty 445.84 ms 492.45 ms 46.61 ms
5c16cdc+dirty 423.48 ms 452.35 ms 28.88 ms
80e4616+dirty 411.58 ms 462.12 ms 50.54 ms
55b77fc+dirty 411.87 ms 417.16 ms 5.29 ms
bca62c0+dirty 414.36 ms 451.06 ms 36.70 ms
0b64753+dirty 448.67 ms 474.61 ms 25.94 ms
4e6d7d7+dirty 480.73 ms 515.73 ms 35.00 ms

App size

Revision Plain With Sentry Diff
4a17c8f+dirty 43.75 MiB 47.99 MiB 4.24 MiB
df1f7df+dirty 43.75 MiB 48.08 MiB 4.33 MiB
a483f9f+dirty 43.75 MiB 48.41 MiB 4.66 MiB
60cd796+dirty 43.75 MiB 48.07 MiB 4.32 MiB
5c16cdc+dirty 17.75 MiB 19.68 MiB 1.94 MiB
80e4616+dirty 43.75 MiB 48.55 MiB 4.80 MiB
55b77fc+dirty 43.75 MiB 47.99 MiB 4.24 MiB
bca62c0+dirty 43.75 MiB 48.41 MiB 4.66 MiB
0b64753+dirty 17.75 MiB 19.70 MiB 1.95 MiB
4e6d7d7+dirty 43.75 MiB 48.40 MiB 4.64 MiB

@antonis antonis merged commit 449b1c8 into main Mar 19, 2026
75 of 96 checks passed
@antonis antonis deleted the feat/android/anr-fingerprinting-option branch March 19, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(android): Expose enableAnrFingerprinting option

2 participants