Repository navigation
Conversation
Require applications to explicitly opt into the crash-prone Debug-based profiler while keeping the legacy implementation available for version 9. Deprecate the option for removal in version 10 and preserve Perfetto continuous profiling on API 35 and newer. Refs GH-5094 Co-Authored-By: Claude <noreply@anthropic.com>
|
PR risk: highFor commit Main concerns: public contract, reach, data sent to Sentry. This label is a hint for reviewers, not an approval. |
| <meta-data | ||
| android:name="io.sentry.traces.profiling.session-sample-rate" | ||
| android:value="1.0" /> | ||
| <!-- Deprecated: temporarily opt into profiling below API 35. Removed in version 10. --> |
There was a problem hiding this comment.
Should we remove this again so people don't get drawn into something we'll remove in v10?
📲 Install BuildsAndroid
|
Close a continuous profiler started from previous-launch configuration when the current options disable legacy profiling. This prevents the current opt-out from retaining the crash-prone legacy backend. Co-Authored-By: Claude <noreply@anthropic.com>
runningcode
left a comment
There was a problem hiding this comment.
So my understanding is that we only ever enable one profiler at a time. That make sense since they consume a lot of resources.
The way the code here is set, it seems like if both are enabled, we prefer the deprecated one, can we change that to prefer the UI Profiling?
We should probably make this behavior when both are enabled more clear in the docs and maybe the changelog too.
|
|
||
| ### Breaking Changes | ||
|
|
||
| - Android: Disable the legacy `Debug`-based profiler by default. Set `enableLegacyProfiling` or the `io.sentry.profiling.enable-legacy-profiling` manifest option to `true` to continue profiling below API 35 or using transaction-based profiling ([#6837](https://github.com/getsentry/sentry-java/pull/6837)) |
There was a problem hiding this comment.
I just added a link to the docs to how to enable the UI Profiling.
| - Android: Disable the legacy `Debug`-based profiler by default. Set `enableLegacyProfiling` or the `io.sentry.profiling.enable-legacy-profiling` manifest option to `true` to continue profiling below API 35 or using transaction-based profiling ([#6837](https://github.com/getsentry/sentry-java/pull/6837)) | |
| - Android: Disable the legacy `Debug`-based profiler by default. Set `enableLegacyProfiling` or the `io.sentry.profiling.enable-legacy-profiling` manifest option to `true` to continue profiling below API 35 or switch to using [UI Profiling](https://docs.sentry.io/platforms/android/profiling/) ([#6837](https://github.com/getsentry/sentry-java/pull/6837)) |
📜 Description
Changes the Android
enableLegacyProfilingdefault fromtruetofalsefor version 9. The legacyDebug-based transaction and continuous profilers remain available, but applications must explicitly opt in on API levels below 35 or when using transaction-based profiling.The option is now deprecated for removal in version 10. API 35+ continues to use Perfetto continuous profiling, including when a legacy transaction profiling sample rate is still configured. Persisted pre-v9 app-start profiling configuration is ignored so it cannot enable the legacy profiler once after an upgrade.
💡 Motivation and Context
Android's legacy runtime tracer can cause Android Runtime crashes. Disabling it by default reduces that risk without removing profiling V1 or the pre-API-35 backend during the version 9 release cycle.
Refs #5094
💚 How did you test it?
./gradlew :sentry:clean :sentry:test --tests io.sentry.SentryOptionsTest --tests io.sentry.JsonSerializerTest --tests io.sentry.SentryTest./gradlew :sentry-android-core:testReleaseUnitTest --tests io.sentry.android.core.AndroidOptionsInitializerTest --tests io.sentry.android.core.ManifestMetadataReaderTest --tests io.sentry.android.core.SentryPerformanceProviderTestmake format api📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
getsentry/sentry-docsand onboarding ingetsentry/sentrybefore the version 9 release.