diff --git a/CHANGELOG.md b/CHANGELOG.md index 7df988a3684..847b9fb8186 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,52 @@ ### Features -- Continuous Profiling - stop when app goes in background ([#4311](https://github.com/getsentry/sentry-java/pull/4311)) -- Continuous Profiling - Add delayed stop ([#4293](https://github.com/getsentry/sentry-java/pull/4293)) -- Continuous Profiling - Out of Experimental ([#4310](https://github.com/getsentry/sentry-java/pull/4310)) +- UI Profiling GA + + 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/. + Note: Both `options.profilesSampler` and `options.profilesSampleRate` must **not** be set to enable UI Profiling. + To keep the same transaction-based behaviour, without the 30 seconds limitation, you can use the `trace` lifecycle mode. + + ```xml + + + + + + + + + ``` + ```java + import io.sentry.ProfileLifecycle; + import io.sentry.android.core.SentryAndroid; + + SentryAndroid.init(context, options -> { + // Enable UI profiling, adjust in production env. This is evaluated only once per session + options.setProfileSessionSampleRate(1.0); + // 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) + options.setProfileLifecycle(ProfileLifecycle.TRACE); + // Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes + options.setStartProfilerOnAppStart(true); + }); + ``` + ```kotlin + import io.sentry.ProfileLifecycle + import io.sentry.android.core.SentryAndroid + + SentryAndroid.init(context, { options -> + // Enable UI profiling, adjust in production env. This is evaluated only once per session + options.profileSessionSampleRate = 1.0 + // 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) + options.profileLifecycle = ProfileLifecycle.TRACE + // Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes + options.isStartProfilerOnAppStart = true + }) + ``` + + - Continuous Profiling - Stop when app goes in background ([#4311](https://github.com/getsentry/sentry-java/pull/4311)) + - Continuous Profiling - Add delayed stop ([#4293](https://github.com/getsentry/sentry-java/pull/4293)) + - Continuous Profiling - Out of Experimental ([#4310](https://github.com/getsentry/sentry-java/pull/4310)) ### Fixes