Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

High ANR report rate with v2.x #406

Closed
tobi512 opened this issue May 13, 2020 · 4 comments
Closed

High ANR report rate with v2.x #406

tobi512 opened this issue May 13, 2020 · 4 comments
Labels
good first issue Good for newcomers

Comments

@tobi512
Copy link

tobi512 commented May 13, 2020

Hi there,
we're running sentry-android v2.0.3 in production since quite a while now and everything seems fine now after you fixed #341.
However, we see a lot of ANRs (which is a new feature since v2.x as far as I know, right?) that we don't see in the Play Console. At first we thought that all those reported ANRs are real and tried to fix some (with no success), but right now we're not so sure about this anymore, which is why i'm opening this issue.

Speaking numbers, we got ~18k (yes, 18 thousand) ANR reports in Sentry till now, while the Play Console only shows around 200 if I sum them up by hand (all app versions, all OS versions in the last 60 days) and also displays "100% daily sessions without ANRs" on the dashboard. Interesting about the ANRs from Sentry is that most of them are coming from devices with Android 6.x.

I see that you use ANR-WatchDog with a threshold of 4000ms for detection while Google has 5s as their threshold (according to https://developer.android.com/topic/performance/vitals/anr) but I really don't think that this difference of 1s is responsible for all the ANR reports that we get from Sentry compare to Google.

The question is now, where are all these reports coming from and why, since we never really see our app hanging during testing nor did we get customer reports about it (with currently over 1 million active installs).

Regards,
Tobias

@marandaneto marandaneto added the question Further information is requested label May 13, 2020
@marandaneto
Copy link
Contributor

hey @tobi512 thanks for raising this.

Some info before getting to the point:

#388 changes the ANR timeout to 5s by default, released on this version https://github.com/getsentry/sentry-android/releases/tag/2.1.0

you can also set a custom timeout adding this to the Manifest:

// 10s
<meta-data android:name="io.sentry.anr.timeout-interval-millis" android:value="10000" />-->

you can also disable the ANR feature as well:
<meta-data android:name="io.sentry.anr.enable" android:value="false" />

ANR is enabled by default on sentry-android-2.x, you are right.

We detect ANRs in a different way comparing to Google Vitals.
eg We don't request user consent to send ANR events as Google does.

We detect ANRs on this way https://github.com/SalomonBrys/ANR-WatchDog

That said, we'll investigate if there's any bug/problem with Android 6, but not only, of course.
Stay tuned.

@marandaneto marandaneto added good first issue Good for newcomers and removed question Further information is requested labels May 13, 2020
@tobi512
Copy link
Author

tobi512 commented May 14, 2020

Hi @marandaneto,
thanks for your quick reply, you guys are doing a great job here!

Customizing the ANR timeout sounds good, we might give that a try or update to the latest version of the SDK.

We detect ANRs in a different way comparing to Google Vitals.
eg We don't request user consent to send ANR events as Google does.

Since the dialog of ANRs only has two buttons ("wait" and "close app"), you're probably talking about the general "automatically share usage and diagnostics data" that is described on https://support.google.com/googleplay/android-developer/answer/6083203?hl=en, correct?
However, if all those ANRs would not be collected that would also mean we don't get crash data via the Play Console since it's only possible to disable both with "automatically share usage and diagnostics data". We see a lot of crash data, so I'm pretty sure that the majority of users has that option enabled, therefore that would not be a valid explanation.

Anyways, thanks for investigating. Maybe it makes sense to ask the maintainers of https://github.com/SalomonBrys/ANR-WatchDog for help at some point?

Cheers!

@marandaneto
Copy link
Contributor

hey @tobi512 thank you :) keep also letting us know how we can make it even better.

We've done some improvements on ANR detection feature and we'd love to get feedback on real and large Apps like yours.

Please upgrade the SDK to https://github.com/getsentry/sentry-android/releases/tag/2.1.2 and let us know how it goes.

Feel free to reopen or raise a new issue if you find anything.

Cheers.

@tobi512
Copy link
Author

tobi512 commented May 19, 2020

Thanks for the quick release, I'll let you know if anything changes!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants