-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
Fix pre warmed app start measurement #1897
Comments
Can we get values from MetricKit about the startup related to the transaction that launched the app? |
No, we can't because we don't get launch data in real-time. You get it once per day: see #1661 (comment) |
According to the Apple docs
And
So we could check if the runtime init and the process start time are some threshold in the past to assume it is an pre warmed app start. We could then just ditch Pre Main and UIKit and Application Init and create a new app start type pre warmed. MetricKit has a special histogram for pre warmed app starts. Taken from our docs:
|
Prewarming can execute code up to I dug into some transactions of customers and found a few transactions similar to this one: The above screenshot shows missing instrumentation of around 4 hours in between Discover query to reveal such transactions: An answer on StackOverflow supports this claim. More screenshotsDiscover query used: Pausing after process creation |
Maybe using |
It seems like we can use, see https://eisel.me/startup
|
@mitsuhiko, @k-fish, and I agreed on reporting the app start type in the app context as |
To sum up: latest sdk version doesn't send bogus app start anymore. The startup time metric is accurate. It doesn't send pre warn info yet. It's the last pending feature we want to add to this. |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Report pre-warmed app starts by dropping the first app start spans if pre-warming paused during these steps. This approach will shorten the app start duration, but it represents the duration a user has to wait after clicking the app icon until the app is responsive. We report the app start type in the appContext, so Sentry can make changes to the UI for prewarmed app starts. Fixes GH-1897
Description
Since iOS 15, the system might decide to pre-warm your app before the user tries to open it. In such cases, we can't reliably measure the app start, and we started to drop reporting app start measurements with #1896. Otherwise, we would get app start times ranging from one minute to even days.
According to a former Apple engineer, you should use MetricKit to collect statistics on app start because MetricKit uses internal OS values, which are not exposed otherwise. MetricKit works on iOS 13 and above. Maybe it's time to replace our own SentryAppStartTracker.
See also #1661. [Internal Notion page] (https://www.notion.so/sentry/Detecting-iOS-15-App-Prewarming-c892f118bdd34b558eb187796ed5e424) on how to detect pre-warmed app starts with data we can't share in public, and another Notion page for a DACI on how to report pre-warmed app starts again.
Related PRs:
The text was updated successfully, but these errors were encountered: