You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/android/configuration/options.mdx
+34-2Lines changed: 34 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -305,13 +305,13 @@ Set this boolean to `false` to disable tracing for `OPTIONS` requests. This opti
305
305
306
306
<ConfigKeyname="profiles-sample-rate">
307
307
308
-
A number between `0` and `1`, controlling the percentage chance a given profile will be sent to Sentry. (`0` represents 0% while `1` represents 100%.) Applies only to sampled transactions created in the app. Either this or <PlatformIdentifiername="profiles-sampler" /> must be defined to enable profiling.
308
+
A number between `0` and `1`, controlling the percentage chance a given profile will be sent to Sentry. (`0` represents 0% while `1` represents 100%.) Applies only to sampled transactions created in the app. Either this or <PlatformIdentifiername="profiles-sampler" /> must be defined to enable transaction profiling. Don't set it if you want to use <PlatformLinkto="/profiling/#continuous-profiling">Continuous Profiling</PlatformLink>.
309
309
310
310
</ConfigKey>
311
311
312
312
<ConfigKeyname="profiles-sampler">
313
313
314
-
A function responsible for determining the percentage chance a given profile will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering profiles, by returning 0 for those that are unwanted. Either this or <PlatformIdentifiername="profiles-sample-rate" /> must be defined to enable profiling.
314
+
A function responsible for determining the percentage chance a given profile will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering profiles, by returning 0 for those that are unwanted. Either this or <PlatformIdentifiername="profiles-sample-rate" /> must be defined to enable transaction profiling. Don't set it if you want to use <PlatformLinkto="/profiling/#continuous-profiling">Continuous Profiling</PlatformLink>.
315
315
316
316
</ConfigKey>
317
317
@@ -320,3 +320,35 @@ A function responsible for determining the percentage chance a given profile wil
320
320
A boolean value that determines whether the app start process will be profiled. When true, the startup process, including ContentProviders, Application and first Activity creation, will be profiled. Note that <PlatformIdentifiername="profiles-sample-rate" /> or <PlatformIdentifiername="profiles-sampler" /> must be defined.
321
321
322
322
</ConfigKey>
323
+
324
+
## Continuous Profiling Options
325
+
326
+
<Alert>
327
+
328
+
This feature is experimental and may have bugs.
329
+
330
+
</Alert>
331
+
332
+
<ConfigKeyname="profile-session-sample-rate">
333
+
334
+
A number between `0` and `1`, controlling the percentage chance the session will be profiled. `0` represents 0% while `1` represents 100%. The default is null (disabled). <PlatformIdentifiername="profiles-sampler" /> and <PlatformIdentifiername="profiles-sample-rate" /> must not be set to enable <PlatformLinkto="/profiling/#continuous-profiling">Continuous Profiling</PlatformLink>.
335
+
336
+
</ConfigKey>
337
+
338
+
<ConfigKeyname="profile-lifecycle">
339
+
340
+
Whether the profiling lifecycle is controlled manually or based on the trace lifecycle. Possible values are:
341
+
342
+
-`manual`: **default** Profiler must be started and stopped through `Sentry.startProfiler()` and `Sentry.stopProfiler()` APIs
343
+
-`trace`: Profiler is started and stopped automatically whenever a sampled trace starts and finishes
344
+
345
+
</ConfigKey>
346
+
347
+
<ConfigKeyname="start-profiler-on-app-start">
348
+
349
+
A boolean value that determines whether the app start process will be profiled. When true, the startup process, including ContentProviders, Application and first Activity creation, will be profiled. Note that <PlatformIdentifiername="profile-session-sample-rate" /> must be defined.
350
+
351
+
- If profileLifecycle is set to `manual`: profiling is started automatically on startup and stopProfiler must be called manually whenever the app startup is deemed to be completed
352
+
- If profileLifecycle is set to `trace`: profiling is started automatically on startup, and will automatically be stopped when the root span that is associated with app startup ends
<!-- Add data like request headers, user ip address and device name, see https://docs.sentry.io/platforms/android/data-management/data-collected/ for more info -->
Copy file name to clipboardExpand all lines: docs/platforms/android/profiling/index.mdx
+79Lines changed: 79 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,3 +68,82 @@ The SDK won't run app start profiling the very first time the app runs, as the S
68
68
The SDK will set the `isForNextAppStart` flag in `TransactionContext` if app start profiling is enabled.
69
69
70
70
</Alert>
71
+
72
+
## Continuous Profiling
73
+
74
+
<Alert>
75
+
76
+
This feature is experimental and may have bugs.
77
+
78
+
</Alert>
79
+
80
+
_(New in version 8.5.0)_
81
+
82
+
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.
83
+
84
+
Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `Sentry.startTransaction`. Now, you can start and stop the profiler directly with `Sentry.startProfiler` and `Sentry.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.startProfilerOnAppStart = true` in your call to `SentryAndroid.init`.
85
+
86
+
Continuous profiling requires only the `SentryOptions.profileSessionSampleRate` option to be set 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.
87
+
88
+
There are two ways to start the profiler: manually, calling `Sentry.startProfiler` and `Sentry.stopProfiler` to start and stop the profiler, or automatically whenever a sampled trace starts and finishes. The latter behaviour is very similar to the current profiling implementation. You can control this behaviour setting `SentryOptions.profileLifecycle` to `manual` or `trace` in your call to `SentryAndroid.init`.
89
+
90
+
<Alerttitle="Note">
91
+
92
+
Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024.
Copy file name to clipboardExpand all lines: docs/platforms/apple/common/profiling/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,6 @@ Previously, profiles only ran in tandem with performance transactions that were
113
113
114
114
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.
115
115
116
-
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.
116
+
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 call sites.
117
117
118
118
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