sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Report app exit reasons

Open Angelodaniel opened this issue 1 year ago • 9 comments

Problem Statement

Having more context on ANR's is always required

Solution Brainstorm

https://developer.android.com/reference/android/app/ApplicationExitInfo#REASON_EXCESSIVE_RESOURCE_USAGE

┆Issue is synchronized with this Jira Improvement by Unito

Angelodaniel avatar Dec 04 '24 15:12 Angelodaniel

hi @Angelodaniel thanks for the suggestion! We currently report an ANR when we get the REASON_ANR from the system. We don't receive multiple reasons of the process death, so we cannot add other info to the ANRs, as the only info we receive from the system is REASON_ANR We will discuss how to make sense of other death reasons, especially if we can add them to general crashes

stefanosiano avatar Dec 10 '24 14:12 stefanosiano

That makes sense. Maybe we can use exit information for crashes.

For anr, it would be nice to have a correlation between last click action or memory usage or memory issues.

kozaxinan avatar Dec 10 '24 17:12 kozaxinan

Let's investigate if our DefaultUncaughtExceptionHandler can capture REASON_EXCESSIVE_RESOURCE_USAGE issues as well or not, as we should avoid reporting the same error twice.

markushi avatar Dec 11 '24 14:12 markushi

The DefaultUncaughtExceptionHandler is not able to catch all the reasons the system reports. Let's duplicate - or generalize - the AnrV2Integration to catch all the reasons (except REASON_CRASH and probably REASON_CRASH_NATIVE).

Useful reasons include

Nothing prevents us to report all reasons, though

stefanosiano avatar Dec 13 '24 16:12 stefanosiano

Let's start with having this feature as opt-in.

markushi avatar Dec 18 '24 14:12 markushi

I'd like to add REASON_LOW_MEMORY(link) as the customer would like to capture that as well. @anshulagarwal06 @markushi

Angelodaniel avatar Jul 24 '25 08:07 Angelodaniel

Another one REASON_CRASH_NATIVE

Angelodaniel avatar Jul 24 '25 13:07 Angelodaniel

@Angelodaniel we're likely going to report all of the reasons in some way or another and make it configurable, so you don't need to track the list of reasons customers asked for :)

romtsn avatar Jul 24 '25 14:07 romtsn

That would be great

Angelodaniel avatar Jul 25 '25 08:07 Angelodaniel