getsentry / sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
https://sentry.io/for/cocoa/
MIT License
797 stars 315 forks source link

Enhancing iOS Metrics to Include AppHang-Free Session Tracking #3796

Open Angelodaniel opened 5 months ago

Angelodaniel commented 5 months ago

Problem Statement

I'm interested in calculating the number of sessions that are free from AppHangs.

Is there a method to obtain the number of sessions that have been marked as experiencing AppHangs?

Currently I don't have a way to filter the session data by mechanism, title or other related error event data.

Happy to understand what is needed and what the potential time line could be

Solution Brainstorm

With the New Metrics coming up, would that be a scenario to explore?

Are you willing to submit a PR?

No response

┆Issue is synchronized with this Jira Improvement by Unito

kahest commented 5 months ago

Metrics support for iOS is on the way and will be available later this quarter. In the next 1-2 quarters we will investigate providing session/release health data via metrics ootb on the SDK side. Until then, sending custom metrics for number of sessions and total number of app hangs should be relatively easy to achieve using the metrics API and the SDK's callbacks. Tracking session status beyond that (e.g. one session can have multiple errors and/or app hangs, and later crash) is more complex.

related: #3319 is about App Hangs rate based on the current Sessions/Release Health product

kahest commented 1 month ago

Support for App Hang Rate is captured in #3319 and is a pre-requisite for the use case stated here (paraphrased from the title) - "more granular reporting on how App Hangs affect users and sessions".

Solving for this and "filter the session data by mechanism, title or other related error event data" (TBD @Angelodaniel this is not a use case, more of a solution) would likely involve a larger re-imagining of the Releases product, and would also unlock the same granularity and flexibility for reporting e.g. ANR Rates, CFSR based on tags, or how specific events affect CFUR.