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
|
064d3f1 to
7a7d63f
Compare
fd450bb to
54be119
Compare
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3d04aae | 324.42 ms | 359.30 ms | 34.88 ms |
| 69d43cc | 380.70 ms | 424.90 ms | 44.20 ms |
| 2821a4d | 315.46 ms | 366.56 ms | 51.10 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3d04aae | 0 B | 0 B | 0 B |
| 69d43cc | 0 B | 0 B | 0 B |
| 2821a4d | 0 B | 0 B | 0 B |
8 tasks
…ndroid extender Replaces the AppStartMetrics IAppStartExtender implementation and the deferred ExtendedAppStartSpan with a focused, lock-guarded AppStartExtension that owns the eager App Start transaction and extended span. AppStartMetrics now only holds the component and exposes isAppStartWindowOpen(). Inert until 3/4 registers the listener. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
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