feat(extend-app-start): [3/4] Materialize extended app start span and extend the vital#5608
Draft
buenaflor wants to merge 2 commits into
Draft
Conversation
…tartMetrics extension state Adds ExtendedAppStartSpan, a deferred ISpan that buffers an early finish and materializes into a real child span once the app start transaction exists. AppStartMetrics now implements IAppStartExtender with window guards, materialization state, and a deadline-aware end-time accessor for the app start vital. Registered via AndroidOptionsInitializer. Inert end-to-end until ALI materializes the span (PR3) and the public Sentry facade is added (PR4). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d the vital Wires the deferred extended span into all three app start transaction paths (standalone, non-standalone ui.load, headless) via a materializeExtendedAppStart helper, holding each transaction open with waitForChildren + deadline until the extension finishes. The app start vital now measures process start to the extended end on a user finish, and is suppressed entirely when the extension hits the deadline (never emitting an inflated ~30s value). The extend guard ignores the foreground check so headless app starts can also be extended. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
This was referenced Jun 23, 2026
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
54be119 to
d2b96ad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Extend App Start)
📜 Description
Wires the deferred extended span into the app start measurement and makes the feature work end-to-end:
ActivityLifecycleIntegration— amaterializeExtendedAppStart(parent)helper attaches anapp.start.extended_app_start("Extended App Start") child in all three paths: standalone (app.starttransaction), non-standalone (under theapp.start.cold/warmspan of theui.loadtransaction), and headless. The standalone and headless transactions getwaitForChildren+ a deadline when an extension is pending, so they stay open until the extension finishes (theui.loadtransaction already does).PerformanceAndroidEventProcessor— the app start vital now measures process start → extended end on a user finish. When the extension hits the deadline (DEADLINE_EXCEEDED), the measurement is suppressed entirely so we never emit an artificially inflated (~30s) value; the app start spans are still attached. Non-extended app starts are unchanged.AppStartMetrics— addsisAppStartExtended(), resets extension state inonAppStartSpansSent()(so a stale span can't affect a later warm start), and relaxes the extend guard's foreground check so headless app starts can be extended (the window guards still apply).app_start_typeis inherited automatically — the extended span lives under the app start span, so the transaction still carries the App-contextstart_type.💡 Motivation and Context
Third PR of the stack implementing the app start extension API (part of #5553). This is the PR where the extension actually affects the trace and the vital.
💚 How did you test it?
Unit tests (TDD):
ActivityLifecycleIntegrationTest— standalone / non-standalone / headless each attach theapp.start.extended_app_startchild; standalone & headless transactions stay open untilfinishAppStart().PerformanceAndroidEventProcessorTest— extended end drives the cold measurement; deadline finish suppresses the measurement.AppStartMetricsTest— extension allowed when not in foreground (headless)../gradlew :sentry-android-core:apiCheck, spotless, and the full:sentry-android-coreunit suite pass.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
[4/4]— add the publicSentry.extendAppStart()/Sentry.finishAppStart()/Sentry.getExtendedAppStartSpan()facade.#skip-changelog