feat(extend-app-start): [2/4] Add deferred extended span and extension state#5606
Draft
buenaflor wants to merge 1 commit into
Draft
feat(extend-app-start): [2/4] Add deferred extended span and extension state#5606buenaflor wants to merge 1 commit into
buenaflor wants to merge 1 commit into
Conversation
Contributor
|
This was referenced Jun 23, 2026
📲 Install BuildsAndroid
|
…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>
064d3f1 to
7a7d63f
Compare
fd450bb to
54be119
Compare
Contributor
Performance metrics 🚀
|
8 tasks
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
Builds the Android machinery behind the
IAppStartExtenderbridge:ExtendedAppStartSpan— a deferredISpancreated inApplication.onCreate, before the app start transaction exists. Pre-materialization, calls delegate toNoOpSpanandfinish(...)buffers the status + call-time timestamp;materialize(realChild)swaps in the real child span and replays a buffered finish. Idempotent.AppStartMetrics implements IAppStartExtender—extendAppStart()(guarded against already-extended / measurements-sent / activity-created / first-frame-drawn),finishAppStart(),getExtendedAppStartSpan(), plus accessors used by the next PR (isExtendedAppStartPending,getPendingExtendedAppStartSpan,markExtendedAppStartMaterialized) and a deadline-awaregetExtendedAppStartEndTime()(returnsnullonDEADLINE_EXCEEDEDso the vital is suppressed rather than inflated).clear()resets the new state.AndroidOptionsInitializer.Still inert end-to-end: nothing materializes the span yet (next PR wires
ActivityLifecycleIntegration+ the vital), and the publicSentryfacade lands last.💡 Motivation and Context
Second PR of the stack implementing the app start extension API (part of #5553).
💚 How did you test it?
Unit tests (TDD):
ExtendedAppStartSpanTest(8 cases) — buffering, materialize replay, delegation, start-date, idempotency.AppStartMetricsTest(11 new cases) — extend creates a pending span; guards warn + ignore; finish idempotency; user-finish vs deadline reflected in the end-time accessor;clear()resets../gradlew :sentry-android-core:apiCheck, spotless, andAndroidOptionsInitializerTest(init wiring) pass.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
[3/4]— materialize the span across the three transaction paths inActivityLifecycleIntegrationand extend/suppress the app start vital inPerformanceAndroidEventProcessor.#skip-changelog