Skip to content

Commit ddf0539

Browse files
philipphofmannlizokmimatwawana
authored
feat(apple): Add docs for pre-warmed app starts (#5762)
Add docs for the experimental feature enablePreWarmedAppStartTracking, which will be released with getsentry/sentry-cocoa#1969. Co-authored-by: Liza Mock <[email protected]> Co-authored-by: Isabel <[email protected]>
1 parent 3d9258e commit ddf0539

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

src/platform-includes/getting-started-config/apple.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ SentrySDK.start { options in
8080

8181
// Enable all experimental features
8282
options.enableUserInteractionTracing = true
83+
options.enablePreWarmedAppStartTracking = true
8384
options.attachScreenshot = true
8485
options.attachViewHierarchy = true
8586
}
@@ -92,6 +93,7 @@ SentrySDK.start { options in
9293

9394
// Enable all experimental features
9495
options.enableUserInteractionTracing = YES;
96+
options.enablePreWarmedAppStartTracking = YES;
9597
options.attachScreenshot = YES;
9698
options.attachViewHierarchy = YES;
9799
}];

src/platforms/apple/common/performance/instrumentation/automatic-instrumentation.mdx

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ This feature is available for iOS, tvOS, and Mac Catalyst.
5555
App Start Tracking is enabled by default once you <PlatformLink to="/performance/">set up performance monitoring</PlatformLink>. This feature provides insight into how long your application takes to launch. It adds spans for different phases, from the application launch to the first auto-generated UI transaction.
5656
To enable this feature, enable `AutoUIPerformanceTracking`.
5757
58-
<Alert level="info" title="Important">
59-
60-
Starting with iOS 15, the system might [pre-warm](https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence#3894431) your app by creating the process before the user opens it. In such cases, we can't reliably measure the app start, so we drop it as of [sentry-cocoa 7.18.0](https://github.com/getsentry/sentry-cocoa/releases/tag/7.18.0). We are working on a fix for this. Follow the [GitHub issue](https://github.com/getsentry/sentry-cocoa/issues/1897) for more details.
61-
62-
</Alert>
63-
6458
The SDK differentiates between a cold and a warm start, but doesn't track hot starts/resumes.
6559
6660
* __Cold start__: App launched for the first time, after a reboot or update. The app is not in memory and no process exists.
@@ -75,6 +69,40 @@ The SDK uses the process start time as the beginning of the app start and the [`
7569
7670
Cold and warm start are Mobile Vitals, which you can learn about in the [full documentation](/product/performance/mobile-vitals).
7771
72+
### Prewarmed App Start Tracking
73+
74+
Starting with iOS 15, the system might [prewarm](https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence#3894431) your app by creating the process before the user opens it. In these cases, we won’t be able to reliably measure the app start. However, with [sentry-cocoa 7.31.0](https://github.com/getsentry/sentry-cocoa/releases/tag/7.31.0), we’ve introduced an `enablePreWarmedAppStartTracking` feature (still in its experimental phase), which allows us to collect prewarmed app starts.
75+
76+
Once enabled, the SDK drops the first app start span if prewarming pauses. This approach shortens the app start duration, but it accurately represents the span of time from when a user clicks the app icon to when the app is responsive.
77+
With this feature, the SDK differentiates between four different app start types:
78+
79+
* __Non-prewarmed cold start__ (See _cold start_ definition above.)
80+
* __Non-prewarmed warm start__ (See _warm start_ definition above.)
81+
* __Prewarmed cold start__
82+
* __Prewarmed warm start__
83+
84+
You can filter for different app start types in [Discover](/product/discover-queries/) with `app_start_type:cold.prewarmed`, `app_start_type:warm.prewarmed`, `app_start_type:cold`, and `app_start_type:warm`.
85+
86+
To enable prewarmed app start tracking:
87+
88+
```swift {tabTitle:Swift}
89+
import Sentry
90+
91+
SentrySDK.start { options in
92+
options.dsn = "___PUBLIC_DSN___"
93+
options.enablePreWarmedAppStartTracking = true
94+
}
95+
```
96+
97+
```objc {tabTitle:Objective-C}
98+
@import Sentry;
99+
100+
[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
101+
options.dsn = @"___PUBLIC_DSN___";
102+
options.enablePreWarmedAppStartTracking = YES;
103+
}];
104+
```
105+
78106
## Slow and Frozen Frames
79107
80108
This feature is available for iOS, tvOS, and Mac Catalyst.

src/wizard/apple/ios.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ SentrySDK.start { options in
118118

119119
// Enable all experimental features
120120
options.enableUserInteractionTracing = true
121+
options.enablePreWarmedAppStartTracking = true
121122
options.attachScreenshot = true
122123
options.attachViewHierarchy = true
123124
}

0 commit comments

Comments
 (0)