Product Benefits Pricing Guides Docs About Contact us Try it out
Performance

Sentry Cocoa MetricKit Launch Diagnostics Tracking

Sentry Cocoa MetricKit launch diagnostics tracking: capture slow iOS app launches and field CPU, memory and network metrics from real devices.

· 3 min read

Slow launches are one of the quietest ways to lose users on iOS. Your own timers only run once your code is running, so they miss the work the system does before that point. And lab tests on a fast development phone rarely match what people experience on older hardware with a full storage drive.

Apple’s MetricKit reports what actually happened on real devices. Sentry Cocoa 9.32.0 makes more of it available: you can choose which MetricKit diagnostic reports are captured, including crash diagnostics (Swift only). It also captures app launch diagnostics on iOS 16+ and visionOS, and can send MetricKit metric payloads such as CPU, network and memory as Sentry metrics (Swift only).

Without a plan for this data, it becomes noise. With one, it answers a clear question: how long do real users wait before they can use the app, and why?

Data Points to Track

  • launch_type (cold, warm, resume) and launch_duration_ms from the diagnostic report
  • launch_diagnostic_call_stack_id or top frame, to group similar slow launches
  • device_model, os_version and app_version on every event
  • low_power_mode and thermal_state at launch, if your app records them
  • cpu_time_seconds, peak_memory_mb and cellular_bytes_in from the metric payloads
  • diagnostic_report_type (launch, crash, hang, cpu_exception), so each stays separate
  • report_delay_hours, since MetricKit delivers reports on a delay, not instantly
  • previous_app_version for upgrade-related regressions

Setup Steps

  1. Upgrade Sentry Cocoa to 9.32.0 or later.
  2. Choose the reports you want. Enable launch diagnostics first, then add crash diagnostics or metric payloads if your app is written in Swift.
  3. Test on a real device. MetricKit does not produce reports in the simulator, and the first payload can take up to a day to arrive.
  4. Tag every event with app_version and launch_type so releases can be compared.
  5. Separate sources. Keep MetricKit launch data apart from your own in-app launch timer, and chart both on one view.
  6. Review at the release level. Because reports arrive late, look at a version after several days, not hours.
  7. Set a budget, such as the 90th percentile launch time per release, and alert when a version goes over it.

Actionable Insights

Compare the two launch measurements first. If MetricKit shows a much longer wait than your own timer, the extra time is being spent before your code starts: large dynamic frameworks, heavy static initialisers or a bloated app binary. That points to build changes, not feature changes.

Next, split slow launches by device model and thermal state. If slow launches cluster on older devices, set a lower budget for them and defer non-essential work until after the first screen. If they cluster in hot or low-power conditions, they are less urgent.

Finally, use the CPU and memory payloads to check whether a release is simply heavier. A rise in peak memory with no change in features usually means a new dependency, and it is far cheaper to catch in the first week than after a one-star review.