Features
-
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: Bothoptions.profilesSampler
andoptions.profilesSampleRate
must not be set to enable UI Profiling.
To keep the same transaction-based behaviour, without the 30 seconds limitation, you can use thetrace
lifecycle mode.<application> <!-- Enable UI profiling, adjust in production env. This is evaluated only once per session --> <meta-data android:name="io.sentry.traces.profiling.session-sample-rate" android:value="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) --> <meta-data android:name="io.sentry.traces.profiling.lifecycle" android:value="trace" /> <!-- Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes --> <meta-data android:name="io.sentry.traces.profiling.start-on-app-start" android:value="true" /> </application>
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); });
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 })
Fixes
- Compress Screenshots on a background thread (#4295)