Repository navigation
Conversation
MetricKit reports slow app launches through MXAppLaunchDiagnostic on iOS 16 and later and on visionOS, but the SDK ignored them. Add an appLaunch diagnostic report and capture each diagnostic as a handled warning event with the launch duration and the converted call stack. Before v10 apps opt in by adding .appLaunch to enabledDiagnosticReports, so enableMetricKit keeps capturing the same reports. In v10 the default set of diagnostic reports includes it. The iOS-Swift sample app slows down its launch while the --io.sentry.metric-kit.slow-launch override is on. Fixes #9272
Contributor
|
📲 Install BuildsiOS
|
Size Analysis1 component analyzed iOS Builds
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Capture MetricKit app launch diagnostics.
MXAppLaunchDiagnosticreports slow launches with the launch duration and a call stack on iOS 16 and later and on visionOS, but the SDK ignored it.Option
SentryMetricKit.DiagnosticReportgainsappLaunch:The case exists on every platform so the same configuration compiles everywhere, while
MXAppLaunchDiagnosticis only referenced underos(iOS) || os(visionOS)behind an iOS 16 availability check. On macOS it never produces events.Event
Each diagnostic becomes a handled
warningevent with exception typeMXAppLaunchDiagnostic, mechanismmx_app_launch_diagnostic, the valueMXAppLaunchDiagnostic launchDuration:<duration>and the stack trace of the converted call stack tree, the same reduction CPU and disk write exceptions use.isMetricKitEventpicks up the new mechanism, so the client doesn't attach current threads, screenshots or the view hierarchy.Sample app
The iOS-Swift sample blocks the main thread for 8 seconds at launch while the
--io.sentry.metric-kit.slow-launchoverride is on. Like other sample overrides it is available as a scheme launch argument and in the settings screen, and it ignores "disable everything". The shared SDK wrapper enables.appLaunchin v9 builds too.Fixes #9272