Skip to content

Commit 770b5d5

Browse files
armcknightvivianyentrankahest
authored
feat: add explainer on continuous profiling and show how to enable it (#10048)
Co-authored-by: vivianyentran <[email protected]> Co-authored-by: Karl Heinz Struggl <[email protected]>
1 parent 4d4c4db commit 770b5d5

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/platforms/apple/common/features/experimental-features.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Do you want to try some new experimental features? On the latest version of the
99
- Enable <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/#time-to-full-display">Time to Full Display (TTFD)</PlatformLink> to gain insight into how long it takes your view controller to launch and load all of its content.
1010
<PlatformSection notSupported={["apple.tvos", "apple.watchos", "apple.visionos"]}>
1111
- Enable <PlatformLink to="/profiling/#enable-launch-profiling">App Launch Profiling</PlatformLink> to get detailed profiles for your app launches.
12+
- Enable <PlatformLink to="/profiling/#continuous-profiling">Continuous Profiling</PlatformLink> to get full coverage of your app's execution.
1213
</PlatformSection>
1314
- If you use Swift concurrency, stitch together stack traces of your async code with the `swiftAsyncStacktraces` option. Note that you can enable this in your Objective-C project, but only async code written in Swift will be stitched together.
1415

@@ -27,6 +28,7 @@ SentrySDK.start { options in
2728
options.enableTimeToFullDisplayTracing = true
2829
options.enableAppLaunchProfiling = true
2930
options.swiftAsyncStacktraces = true
31+
options.profilesSampleRate = nil // enable continuous profiling mode
3032
}
3133
```
3234

@@ -40,6 +42,7 @@ SentrySDK.start { options in
4042
options.enableTimeToFullDisplayTracing = YES;
4143
options.enableAppLaunchProfiling = YES;
4244
options.swiftAsyncStacktraces = YES; // only applies to async code in Swift
45+
options.profilesSampleRate = nil; // enable continuous profiling mode
4346
}];
4447
```
4548

docs/platforms/apple/common/profiling/index.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,23 @@ To set up launch profiling, use the `enableAppLaunchProfiling` option and config
9898
If you use `SentryOptions.tracesSampler` or `SentryOptions.profilesSampler`, it will be invoked after you call `SentrySDK.startWithOptions`, with `SentryTransactionContext.forNextAppLaunch` set to `true` indicating that it's evaluating a launch profile sampling decision. If instead you simply set `SentryOptions.tracesSampleRate` and `SentryOptions.profilesSampleRate`, those numerical rates will be used directly.
9999
100100
Currently, launch profiles are attached to a special performance transaction operation called `app.launch` and displayed in the product simply as `launch`.
101+
102+
## Continuous Profiling
103+
104+
<Note>
105+
106+
This feature is experimental and may have bugs.
107+
108+
</Note>
109+
110+
_(New in version 8.36.0)_
111+
112+
The current profiling implementation stops the profiler automatically after 30 seconds (unless you manually stop it earlier). Naturally, this limitation makes it difficult to get full coverage of your app's execution. We now offer an experimental continuous mode, where profiling data is periodically uploaded while running, with no limit to how long the profiler may run.
113+
114+
Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `SentrySDK.startTransaction`. Now, you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`.
115+
116+
Continuous profiling mode is enabled by default, requiring no changes to `SentryOptions` when you start the SDK to opt in. If you had previously set `SentryOptions.profilesSampleRate` or `SentryOptions.profilesSampler` to use transaction-based profiling, then remove those lines of code from your configuration.
117+
118+
These new APIs do not offer any sampling functionality—every call to start the profiler will start it, and the same goes for launch profiles if you've configured that. If you are interested in reducing the amount of profiles that run, you must take care to do it at the callsites.
119+
120+
Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024.

0 commit comments

Comments
 (0)