Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report ANRs in RUM mobile android SDKs #23118

Merged
merged 7 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,31 @@

For any given error, you can access the file path, line number, and a code snippet for each frame of the related stack trace.

### Add ANR reporting

Check warning on line 42 in content/en/real_user_monitoring/error_tracking/mobile/android.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.headings

'Add ANR reporting' should use sentence-style capitalization.

An "Application Not Responding" ([ANR][6]) is an Android-specific type of error that gets triggered when the application is unresponsive for too long.

ANRs are only reported through the RUM SDK (not through Logs).

#### Report fatal ANRs

Check warning on line 48 in content/en/real_user_monitoring/error_tracking/mobile/android.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.headings

'Report fatal ANRs' should use sentence-style capitalization.
Fatal ANRs result in crashes. The application reports them when it's unresponsive, leading to the Android OS displaying a popup dialog to the user, who chooses to force quit the app through the popup.

Check notice on line 49 in content/en/real_user_monitoring/error_tracking/mobile/android.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.sentencelength

Suggestion: Try to keep your sentence length to 25 words or fewer.

{{< img src="real_user_monitoring/error_tracking/rum-anr-fatal.png" alt="A fatal crash report in Error Tracking." >}}

- In the **Error Tracking** page, fatal ANRs are grouped based on their similarity, which can result into several **individual issues** being created
- By default, Datadog catches fatal ANRs through the [ApplicationExitInfo API][7] (available since *[Android 30+][8]*), which can be read on the next app launch.
- In *[Android 29][9] and below*, reporting on fatal ANRs is not possible.

#### Report non-fatal ANRs

Check warning on line 57 in content/en/real_user_monitoring/error_tracking/mobile/android.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.headings

'Report non-fatal ANRs' should use sentence-style capitalization.
Non-fatal ANRs may or may not have led to the application being terminated (crashing).

{{< img src="real_user_monitoring/error_tracking/rum-anr-non-fatal.png" alt="A non-fatal crash report in Error Tracking." >}}

- In the **Error Tracking** page, non-fatal ANRs are grouped under a **single** issue due to their level of noise
- By default, the reporting of non-fatal ANRs on *Android 30+* is **disabled** because it would create too much noise over fatal ANRs. On *Android 29* and below, however, the reporting of non-fatal ANRs is **enabled** by default, as fatal ANRs cannot be reported on those versions.

For any Android version, you can override the default setting for reporting non-fatal ANRs by setting `trackNonFatalAnrs` to `true` or `false` when initializing the RUM SDK.

## Get deobfuscated stack traces

### Upload your mapping file
Expand Down Expand Up @@ -74,9 +99,9 @@

**Note**: If your project uses additional flavors, the plugin provides an upload task for each variant with obfuscation enabled. In this case, initialize the RUM Android SDK with a proper variant name (the necessary API is available in versions `1.8.0` and later).


[1]: https://github.com/DataDog/dd-sdk-android-gradle-plugin
[2]: https://app.datadoghq.com/organization-settings/api-keys

{{% /tab %}}
{{% tab "EU" %}}
1. Add the [Android Gradle Plugin][1] to your Gradle project using the following code snippet.
Expand Down Expand Up @@ -105,9 +130,9 @@

**Note**: If your project uses additional flavors, the plugin provides an upload task for each variant with obfuscation enabled. In this case, initialize the RUM Android SDK with a proper variant name (the necessary API is available in versions `1.8.0` and later).


[1]: https://github.com/DataDog/dd-sdk-android-gradle-plugin
[2]: https://app.datadoghq.com/organization-settings/api-keys

{{% /tab %}}
{{< /tabs >}}

Expand Down Expand Up @@ -209,3 +234,7 @@
[3]: /real_user_monitoring/mobile_and_tv_monitoring/setup/android#setup
[4]: https://github.com/DataDog/dd-sdk-android/tree/develop/features/dd-sdk-android-rum
[5]: /real_user_monitoring/mobile_and_tv_monitoring/advanced_configuration/android/?tabs=kotlin#initialization-parameters
[6]: https://developer.android.com/topic/performance/vitals/anr
[7]: https://developer.android.com/reference/android/app/ApplicationExitInfo
[8]: https://developer.android.com/tools/releases/platforms#11
[9]: https://developer.android.com/tools/releases/platforms#10
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.