|
4 | 4 |
|
5 | 5 | ### Features
|
6 | 6 |
|
7 |
| -- Continuous Profiling - stop when app goes in background ([#4311](https://github.com/getsentry/sentry-java/pull/4311)) |
8 |
| -- Continuous Profiling - Add delayed stop ([#4293](https://github.com/getsentry/sentry-java/pull/4293)) |
9 |
| -- Continuous Profiling - Out of Experimental ([#4310](https://github.com/getsentry/sentry-java/pull/4310)) |
| 7 | +- UI Profiling GA |
| 8 | + |
| 9 | + Continuous Profiling is now GA, named UI Profiling. To enable it you can use one of the following options. More info can be found at https://docs.sentry.io/platforms/android/profiling/. |
| 10 | + Note: Both `options.profilesSampler` and `options.profilesSampleRate` must **not** be set to enable UI Profiling. |
| 11 | + To keep the same transaction-based behaviour, without the 30 seconds limitation, you can use the `trace` lifecycle mode. |
| 12 | + |
| 13 | + ```xml |
| 14 | + <application> |
| 15 | + <!-- Enable UI profiling, adjust in production env. This is evaluated only once per session --> |
| 16 | + <meta-data android:name="io.sentry.traces.profiling.session-sample-rate" android:value="1.0" /> |
| 17 | + <!-- Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes) --> |
| 18 | + <meta-data android:name="io.sentry.traces.profiling.lifecycle" android:value="trace" /> |
| 19 | + <!-- Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes --> |
| 20 | + <meta-data android:name="io.sentry.traces.profiling.start-on-app-start" android:value="true" /> |
| 21 | + </application> |
| 22 | + ``` |
| 23 | + ```java |
| 24 | + import io.sentry.ProfileLifecycle; |
| 25 | + import io.sentry.android.core.SentryAndroid; |
| 26 | + |
| 27 | + SentryAndroid.init(context, options -> { |
| 28 | + // Enable UI profiling, adjust in production env. This is evaluated only once per session |
| 29 | + options.setProfileSessionSampleRate(1.0); |
| 30 | + // Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes) |
| 31 | + options.setProfileLifecycle(ProfileLifecycle.TRACE); |
| 32 | + // Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes |
| 33 | + options.setStartProfilerOnAppStart(true); |
| 34 | + }); |
| 35 | + ``` |
| 36 | + ```kotlin |
| 37 | + import io.sentry.ProfileLifecycle |
| 38 | + import io.sentry.android.core.SentryAndroid |
| 39 | + |
| 40 | + SentryAndroid.init(context, { options -> |
| 41 | + // Enable UI profiling, adjust in production env. This is evaluated only once per session |
| 42 | + options.profileSessionSampleRate = 1.0 |
| 43 | + // Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes) |
| 44 | + options.profileLifecycle = ProfileLifecycle.TRACE |
| 45 | + // Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes |
| 46 | + options.isStartProfilerOnAppStart = true |
| 47 | + }) |
| 48 | + ``` |
| 49 | + |
| 50 | + - Continuous Profiling - Stop when app goes in background ([#4311](https://github.com/getsentry/sentry-java/pull/4311)) |
| 51 | + - Continuous Profiling - Add delayed stop ([#4293](https://github.com/getsentry/sentry-java/pull/4293)) |
| 52 | + - Continuous Profiling - Out of Experimental ([#4310](https://github.com/getsentry/sentry-java/pull/4310)) |
10 | 53 |
|
11 | 54 | ### Fixes
|
12 | 55 |
|
|
0 commit comments