You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/android/configuration/app-not-respond.mdx
+37-2Lines changed: 37 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ sidebar_order: 4
4
4
description: "Learn how to turn off or specify ANR."
5
5
---
6
6
7
-
Application Not Responding (ANR) errors are triggered when the main UI thread of an application is blocked for more than five seconds. The Android SDK reports ANR errors as Sentry events. In addition, Sentry calculates [ANR rate](/platforms/android/tracing/instrumentation/performance-metrics/#application-not-responding-anr-rate) based on these events and user sessions.
7
+
Application Not Responding (ANR) errors are triggered when the main UI thread of an application is blocked for more than five seconds. The Android SDK reports ANR errors as Sentry events. In addition, Sentry calculates [ANR rate](#anr-rate) based on these events and user sessions.
8
8
9
9
## ANR implementation details
10
10
@@ -13,7 +13,7 @@ The Android SDK uses different implementations to detect ANRs, depending on what
13
13
- Below Android 11: Running a Watchdog thread (v1)
14
14
- Android 11 and above: Reading [ApplicationExitInfo](https://developer.android.com/reference/android/app/ApplicationExitInfo) (v2)
15
15
16
-
The new implementation (v2) uses the same data source as Google Play Console. This means the reported ANR events and [ANR rate](/platforms/android/tracing/instrumentation/performance-metrics/#application-not-responding-anr-rate) should match with what you see on Sentry. The new implementation also captures a thread dump with additional information, like held locks, to help you resolve ANRs more efficiently.
16
+
The new implementation (v2) uses the same data source as Google Play Console. This means the reported ANR events and [ANR rate](#anr-rate) should match with what you see on Sentry. The new implementation also captures a thread dump with additional information, like held locks, to help you resolve ANRs more efficiently.
17
17
18
18
While the original Watchdog approach (v1) reports many false positives and is based on heuristics, it still has some advantages over v2, like capturing screenshots and transactions with profiles at the time of ANR.
19
19
@@ -125,3 +125,38 @@ This detector looks at the stack trace of an ANR and tries to identify common pi
125
125
Sentry will try to detect deadlocks and point out potential causes. If, for example, the main thread is blocked by waiting on a lock object that's held by another thread, the suspect frame that's waiting on the lock will be highlighted. The stack trace of the offending thread that's holding the lock, as well as the offending frame of that thread will also be shown:
126
126
127
127

128
+
129
+
## ANR Rate
130
+
131
+
ANR rate is the percentage of unique users who have experienced an ANR during the specified time period.
132
+
133
+
<Alertlevel="info">
134
+
135
+
Since there's two implementations for ANR detection, Sentry calculates the ANR Rate depending on the implementation. On Android 11 and above Sentry only accounts for **Fatal ANRs** - ANRs that lead to your app being terminated, either by the user or the OS. On Android 10 and below both Fatal and Non-Fatal ANRs contribute to the ANR Rate calculation.
136
+
137
+
</Alert>
138
+
139
+
### User-perceived ANR Rate
140
+
141
+
User-perceived ANR rate is a core Android vital and is defined more specifically, as the unique percentage of users who've experienced the lack of response to an input event in an app, lasting more than five seconds.
142
+
143
+
A user-perceived ANR rate that's more than 0.47%, is considered over the [bad behavior threshold](https://developer.android.com/topic/performance/vitals#what_are_the_bad_behavior_thresholds), as set by Google. If your app exceeds this threshold, Google Play may choose to reduce your app's visibility in their app store.
144
+
145
+
### Foreground ANR Rate
146
+
147
+
In Sentry, we can monitor the foreground ANR rate, which is the percentage of unique users who've experienced an ANR event lasting more than five seconds, while the app was running in the foreground. Because it's more noticeable to the user, a foreground ANR event is more likely to be seen as an annoyance.
148
+
149
+
While foreground ANR rates may not map exactly to user-perceived ANR rates, they can provide a close proxy. In Sentry, the foreground ANR rate chart has a bad behavior threshold line for comparison.
150
+
151
+
To see your ANR Rate in Sentry:
152
+
153
+
1. Go to the **Projects** page
154
+
2. Click on your Android project
155
+
3. Look for the "ANR Rate" card in the "Project Details" section
156
+
4. Click "View Issues" to see a list of ANR issues that were created in the selected timeframe and environment
157
+
158
+
You can also see an ANR rate graph on a separate card. Opening the "Display" menu will allow you to switch back and forth between the "ANR Rate" and the "Foreground ANR Rate" view.
159
+
160
+

161
+
162
+
Sentry's Android SDK, version 6.13.0 and above, reports ANR rate errors if the main UI thread of your application is blocked for more than five seconds.
Copy file name to clipboardExpand all lines: platform-includes/performance/automatic-performance-metrics/android.mdx
-24Lines changed: 0 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,27 +4,3 @@ If configured, the Android SDK automatically collects the following performance
4
4
.
5
5
- <PlatformLinkto="/tracing/instrumentation/automatic-instrumentation/#slow-and-frozen-frames"> Slow and frozen frame rendering </PlatformLink>
6
6
.
7
-
8
-
## Application Not Responding (ANR) Rate
9
-
10
-
Application Not Responding (ANR) errors are triggered when the main UI thread of an application is blocked for more than five seconds. When configured, Sentry's Android SDK reports [ANR errors](/platforms/android/configuration/app-not-respond/).
11
-
12
-
ANR rate is the percentage of unique users who have experienced an ANR during the specified time period.
13
-
14
-
### User-perceived ANR Rate
15
-
16
-
User-perceived ANR rate is a core Android vital and is defined more specifically, as the unique percentage of users who've experienced the lack of response to an input event in an app, lasting more than five seconds.
17
-
18
-
A user-perceived ANR rate that's more than 0.47%, is considered over the [bad behavior threshold](https://developer.android.com/topic/performance/vitals#what_are_the_bad_behavior_thresholds), as set by Google. If your app exceeds this threshold, Google Play may choose to reduce your app’s visibility in their app store.
19
-
20
-
### Foreground ANR Rate
21
-
22
-
In Sentry, we can monitor the foreground ANR rate, which is the percentage of unique users who’ve experienced an ANR event lasting more than five seconds, while the app was running in the foreground. Because it’s more noticeable to the user, a foreground ANR event is more likely to be seen as an annoyance.
23
-
24
-
While foreground ANR rates may not map exactly to user-perceived ANR rates, they can provide a close proxy. In Sentry, the foreground ANR rate chart has a bad behavior threshold line for comparison.
25
-
26
-
To see your ANR rate in Sentry, go to the **Projects** page, click on your Android project, then look for the ANR rate card in the "Project Details" section. Clicking the "View Issues" button in the "ANR Rate" card will take you to a list of ANR issues that were created in the selected timeframe and environment.
27
-
28
-
You can also see an ANR rate graph on a separate card. Opening the "Display" menu will allow you to switch back and forth between the "ANR Rate" and the "Foreground ANR Rate" view.
29
-
30
-
Sentry's Android SDK, version 6.13.0 and above, reports [ANR rate](/platforms/android/configuration/app-not-respond/) errors if the main UI thread of your application is blocked for more than five seconds.
0 commit comments