Repository navigation
feat(android): Enable standalone app start tracing by default - #6716
runningcode wants to merge 3 commits into
Conversation
App start is now sent as its own App Start transaction instead of an app.start.* child span of the first ui.load transaction. The option and its manifest key stay so apps can opt out, and the option is no longer experimental. AppStartMetrics.clear() now also drops the extend-app-start listener, which otherwise leaks from one ActivityLifecycleIntegrationTest into the next now that most tests register it. Fixes JAVA-503 Fixes #5376 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
PR risk: mediumFor commit Main concerns: public contract, data sent to Sentry, reach. This label is a hint for reviewers, not an approval. |
📲 Install BuildsAndroid
|
| @Test | ||
| fun `extendAppStart is a no-op when standalone tracing is disabled`() { | ||
| val sut = fixture.getSut { it.tracesSampleRate = 1.0 } | ||
| val sut = fixture.getSut { |
There was a problem hiding this comment.
Test assumes one ui.load transaction
Medium Severity
This test calls setAppStartTime() without disabling isEnableStandaloneAppStartTracing. With the new default, onActivityCreated starts both an app.start and a ui.load transaction, so the implicit single-call verify on startTransaction (and the ui.load op check) no longer holds. Nearby child-span tests were updated; this one was not.
Triggered by project rule: PR Review Guidelines for Cursor Bugbot
Reviewed by Cursor Bugbot for commit 6f0879b. Configure here.
Instead of turning the new default off for all UI tests, MockRelay keeps app start transactions apart. They don't count as expected requests and don't use up custom responses, since whether a headless app start is sent depends on the process importance. Tests that launch an Activity assert exactly one app start transaction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a151e1b. Configure here.
| transaction2.finish() | ||
|
|
||
| relay.assert { | ||
| assertAppStartTransaction() |
There was a problem hiding this comment.
App start assert races with re-init
Medium Severity
doubleInitWithSameOptionsDoesNotThrow now requires exactly one App Start envelope, but it re-inits Sentry immediately after launchActivity. App start is often finished on first frame, which can still be pending after RESUMED, and MockRelay never counts those envelopes toward idling. assertAppStartTransaction() then fails when the list is empty, or if a delayed headless start arrives as well.
Additional Locations (2)
Triggered by project rule: AGENTS.md
Reviewed by Cursor Bugbot for commit a151e1b. Configure here.
| - Remove the Android `enablePerformanceV2` option and its `io.sentry.performance-v2.enable` manifest metadata. Performance V2 is always on ([#6458](https://github.com/getsentry/sentry-java/pull/6458)) | ||
| - App starts are measured from process start on Android 7.0+ (API 24), and slow and frozen frames are measured per span | ||
| - `ActivityFramesTracker` is removed, and the `ActivityLifecycleIntegration` constructor no longer takes it | ||
| - Enable standalone app start tracing on Android by default. App start is sent as its own `App Start` transaction instead of an `app.start.*` child span of the first `ui.load` transaction. More accurate app launch tracking, resulting in higher span consumption on Android. To keep the previous behavior, set `options.isEnableStandaloneAppStartTracing = false` or the `io.sentry.standalone-app-start-tracing.enable` manifest metadata to `false` ([#6716](https://github.com/getsentry/sentry-java/pull/6716)) |
There was a problem hiding this comment.
| - Enable standalone app start tracing on Android by default. App start is sent as its own `App Start` transaction instead of an `app.start.*` child span of the first `ui.load` transaction. More accurate app launch tracking, resulting in higher span consumption on Android. To keep the previous behavior, set `options.isEnableStandaloneAppStartTracing = false` or the `io.sentry.standalone-app-start-tracing.enable` manifest metadata to `false` ([#6716](https://github.com/getsentry/sentry-java/pull/6716)) | |
| - Enable standalone app start tracing on Android by default. App start is sent as its own `App Start` transaction instead of an `app.start.*` child span of the first `ui.load` transaction. More accurate app launch tracking, resulting in higher span quota consumption on Android. To keep the previous behavior, set `options.isEnableStandaloneAppStartTracing = false` or the `io.sentry.standalone-app-start-tracing.enable` manifest metadata to `false` ([#6716](https://github.com/getsentry/sentry-java/pull/6716)) |


📜 Description
Turn on standalone app start tracing by default in 9.0.
That means the app start is now sent as its own
App Starttransaction (app.start) instead of anapp.start.*child span of the firstui.loadtransaction.The option and the
io.sentry.standalone-app-start-tracing.enablemanifest key stay, so apps can opt out withfalse. The option is no longer@ApiStatus.Experimental.Things worth a look:
Native.EnableTracingis on (off by default), and then its apps get the standalone transaction too.💡 Motivation and Context
💚 How did you test it?
Unit tests in
sentry-android-core, and thesentry-uitest-androidsuite on an emulator.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Update the Android tracing docs, which still describe the option as opt-in, when 9.0 ships.
🤖 Generated with Claude Code