Skip to content
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

feat: add explainer on continuous profiling and show how to enable it #10048

Merged
merged 8 commits into from
Aug 27, 2024
16 changes: 16 additions & 0 deletions docs/platforms/apple/common/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,19 @@ To set up launch profiling, use the `enableAppLaunchProfiling` option and config
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.

Currently, launch profiles are attached to a special performance transaction operation called `app.launch` and displayed in the product simply as `launch`.

## Continuous Profiling

<Note>

This feature is experimental and may have bugs.

</Note>

The current profiling implementation stops the profiler automatically after 30 seconds, if you do not 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.
armcknight marked this conversation as resolved.
Show resolved Hide resolved

Whereas profiles previously only ran in tandem with a performance transaction that you'd either start manually with `SentrySDK.startTransaction` or with an automatic transaction, now you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. Launch profiling is another way to start it, by simply setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`.
armcknight marked this conversation as resolved.
Show resolved Hide resolved

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.
armcknight marked this conversation as resolved.
Show resolved Hide resolved

Continuous profiling has implications for your org's billing structure. You must be enrolled in AM3 billing to see this data on your dashboard.
armcknight marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ SentrySDK.start { options in
options.enableTimeToFullDisplayTracing = true
options.swiftAsyncStacktraces = true
options.enableAppLaunchProfiling = true
options.enableContinuousProfiling = true
}
```

Expand All @@ -31,6 +32,7 @@ SentrySDK.start { options in
options.enableTimeToFullDisplayTracing = YES;
options.swiftAsyncStacktraces = YES;
options.enableAppLaunchProfiling = YES;
options.enableContinuousProfiling = YES;
}];
```

Expand Down
Loading