feat(android): Set app start vitals on standalone app start children - #6005
feat(android): Set app start vitals on standalone app start children#6005buenaflor wants to merge 6 commits into
Conversation
Copy app.vitals.start.screen and app.vitals.start.type onto every span under standalone app.start, including user work under the extended span, so they can be grouped with the root. Co-authored-by: Cursor <cursoragent@cursor.com>
|
📲 Install BuildsAndroid
|
Co-authored-by: Cursor <cursoragent@cursor.com>
…getsentry/sentry-java into cursor/96f09872
There was a problem hiding this comment.
Pull request overview
This PR updates the Android app start transaction processing so standalone app.start transactions consistently expose app.vitals.start.type on the transaction root and propagate app.vitals.start.screen + app.vitals.start.type to all child spans (including user spans under app.start.extended), while keeping the ui.load-attached app start behavior unchanged.
Changes:
- Add
app.vitals.start.type(APP_START_TYPE_DATA) and set it on standalone app start transaction roots. - Propagate
app.vitals.start.typeand (when present)app.vitals.start.screenfrom the standalone app start root to all child spans. - Add/extend unit tests covering foreground, headless, extended/user-span descendants, and non-propagation for
ui.load-attached app start.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sentry-android-core/src/main/java/io/sentry/android/core/PerformanceAndroidEventProcessor.java | Sets app.vitals.start.type on standalone app start roots and copies type/screen to child spans. |
| sentry-android-core/src/main/java/io/sentry/android/core/ActivityLifecycleIntegration.java | Introduces the APP_START_TYPE_DATA constant (app.vitals.start.type). |
| sentry-android-core/src/test/java/io/sentry/android/core/PerformanceAndroidEventProcessorTest.kt | Adds test coverage for propagation behavior across standalone app start scenarios. |
| sentry-android-core/build.gradle.kts | Adds Truth assertions dependency for new tests. |
| CHANGELOG.md | Adds an Unreleased feature entry describing the new standalone app start attribute propagation. |
Suppressed comments (1)
sentry-android-core/build.gradle.kts:122
libs.google.truthis declared twice in the test dependencies block, which is redundant and can cause confusion when scanning dependency lists. Keep a single declaration.
testImplementation(libs.google.truth)
testImplementation(libs.androidx.core.ktx)
testImplementation(libs.androidx.test.core)
testImplementation(libs.androidx.test.ext.junit)
testImplementation(libs.androidx.test.runner)
testImplementation(libs.awaitility.kotlin)
testImplementation(libs.google.truth)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d6b859a. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>

📜 Description
Set
app.vitals.start.typeon the standaloneapp.startroot, and copyapp.vitals.start.screen+app.vitals.start.typeonto all of its children — including user spans underapp.start.extended. Headless starts omit screen. Theui.load-attached app start path is unchanged.💡 Motivation and Context
Mobile vitals app start breakdown with
app.startchildren with the root using these attributes. They were only on the root, so child spans did not group. Matches Flutter (getsentry/sentry-dart#3988).Example of the sample app app start breakdown (previously empty without this PR):

Related to getsentry/sentry#122577
💚 How did you test it?
Unit tests in
PerformanceAndroidEventProcessorTest(foreground, user descendants underapp.start.extended, headless,ui.loadnon-propagation). Verified onsentry-samples-android(debug) that the envelope includes both attributes on the root,app.start.extended, and user children.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Made with Cursor