feat(tracing): Add extend app start API for standalone app start#6392
Open
antonis wants to merge 8 commits into
Open
feat(tracing): Add extend app start API for standalone app start#6392antonis wants to merge 8 commits into
antonis wants to merge 8 commits into
Conversation
…675) Add experimental `extendAppStart()`, `finishExtendedAppStart()`, and `getExtendedAppStartSpan()` to keep the standalone `app.start` transaction open past the auto-detected end so post-init work (remote config, session restore, etc.) is included and can be broken down into child spans under an `app.start.extended` span. - `extendAppStart()` cancels the deferred auto-capture, holds the transaction open, and starts a 30s deadline. - `finishExtendedAppStart()` finalizes: trims the end to the last child (floored at the default app start end) and sets the measurement at finalization. - On the deadline the transaction is captured but the `app.vitals.start` measurement is suppressed (never emit a ~30s app start). - `attachAppStartToTransactionEvent` now takes `suppressMeasurement` and returns whether it attached, so the finalize path decides send vs skip. Standalone-only. `appLoaded()` stays as-is for now; its deprecation and removal, plus making standalone the default, are handled together in RN-676 (v9). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Contributor
|
antonis
commented
Jul 2, 2026
- extendAppStart(): claim the run only after confirming a recording span, so a sampled-out/disabled run falls back to the normal capture path. - Cap the 60s app start sanity check on the native window, not the extended end, so a legitimately extended app start is not dropped. - Thread the extended end explicitly instead of mutating shared appStartEndData, so the extended end survives without wrap()/appLoaded(). - Guard app start attach with a run generation so a finish suspended at the native-data await bails when a new runApplication run starts, instead of corrupting the new run's state. - finishExtendedAppStart() returns Promise<void> so callers can await before flush(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…i-to-extend-app-start-react-native
The app start attach also awaits fetchNativeFramesDelay (~2s) after the first generation check; a runApplication reset during that window could still send a stale standalone transaction. Re-check the generation before reporting success. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e (RN-675) - getLatestChildSpanEndTimestamp was computed on the root transaction, which includes the extended (wrapper) span itself; since the wrapper ends at finalization time, the transaction was pinned to the finishExtendedAppStart() call rather than the last instrumented child. Compute the trim from the wrapper's children (excluding the wrapper) on the explicit-finish path, end the wrapper at that trimmed time so it never outlives the root, and keep the full-window end on the deadline path. Floored at the default app start end and the wrapper start. - Regenerate the API report against @sentry/core 10.63.0 (restores the deeplinkIntegration signature that a stale local build had reverted). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📲 Install BuildsAndroid
|
Contributor
Author
|
@sentry review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 53bc223. Configure here.
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 21a1e70+dirty | 3834.15 ms | 1218.43 ms | -2615.73 ms |
| 882f8ae+dirty | 3840.30 ms | 1224.41 ms | -2615.88 ms |
| 15d4514+dirty | 3840.17 ms | 1225.79 ms | -2614.38 ms |
| 0b5a379+dirty | 3828.91 ms | 1214.12 ms | -2614.79 ms |
| f3215d3+dirty | 3842.73 ms | 1219.33 ms | -2623.40 ms |
| ab203f9+dirty | 3848.07 ms | 1219.71 ms | -2628.35 ms |
| 6177334+dirty | 3834.85 ms | 1217.58 ms | -2617.28 ms |
| 5257d80+dirty | 3854.39 ms | 1234.28 ms | -2620.11 ms |
| 9474ead+dirty | 3864.29 ms | 1223.55 ms | -2640.74 ms |
| 1122a96+dirty | 3823.10 ms | 1218.64 ms | -2604.46 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 21a1e70+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| 882f8ae+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 15d4514+dirty | 5.15 MiB | 6.70 MiB | 1.55 MiB |
| 0b5a379+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| f3215d3+dirty | 5.15 MiB | 6.67 MiB | 1.52 MiB |
| ab203f9+dirty | 4.98 MiB | 6.51 MiB | 1.53 MiB |
| 6177334+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 5257d80+dirty | 5.15 MiB | 6.69 MiB | 1.54 MiB |
| 9474ead+dirty | 5.15 MiB | 6.71 MiB | 1.55 MiB |
| 1122a96+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
…i-to-extend-app-start-react-native
…ased Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eb93136+dirty | 3846.51 ms | 1226.13 ms | -2620.39 ms |
| ad66da3+dirty | 3855.02 ms | 1213.43 ms | -2641.59 ms |
| b04af96+dirty | 3830.54 ms | 1206.11 ms | -2624.44 ms |
| 9210ae6+dirty | 3834.11 ms | 1216.64 ms | -2617.47 ms |
| ca9d079+dirty | 3818.62 ms | 1216.72 ms | -2601.90 ms |
| 09a902f+dirty | 3847.65 ms | 1221.31 ms | -2626.34 ms |
| 5a21b51+dirty | 3837.87 ms | 1223.47 ms | -2614.40 ms |
| d038a14+dirty | 3831.11 ms | 1216.30 ms | -2614.81 ms |
| 64630e5+dirty | 3845.49 ms | 1215.19 ms | -2630.30 ms |
| f3215d3+dirty | 3846.08 ms | 1231.85 ms | -2614.23 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eb93136+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| ad66da3+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| b04af96+dirty | 4.98 MiB | 6.54 MiB | 1.56 MiB |
| 9210ae6+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| ca9d079+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| 09a902f+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| 5a21b51+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| d038a14+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 64630e5+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| f3215d3+dirty | 5.15 MiB | 6.67 MiB | 1.52 MiB |
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0d9949d+dirty | 414.88 ms | 428.68 ms | 13.81 ms |
| a736b76+dirty | 405.78 ms | 458.74 ms | 52.96 ms |
| 5569641+dirty | 465.92 ms | 532.22 ms | 66.30 ms |
| 580fb5c+dirty | 515.72 ms | 585.38 ms | 69.66 ms |
| 7ff4d0f+dirty | 403.38 ms | 427.06 ms | 23.68 ms |
| 6177334+dirty | 404.80 ms | 456.74 ms | 51.94 ms |
| 1e5d96d+dirty | 423.33 ms | 482.46 ms | 59.13 ms |
| f170ec3+dirty | 505.96 ms | 551.88 ms | 45.92 ms |
| 20fbd51+dirty | 594.38 ms | 655.35 ms | 60.97 ms |
| f3215d3+dirty | 396.53 ms | 436.66 ms | 40.13 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0d9949d+dirty | 43.94 MiB | 48.99 MiB | 5.05 MiB |
| a736b76+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| 5569641+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| 580fb5c+dirty | 49.74 MiB | 54.79 MiB | 5.05 MiB |
| 7ff4d0f+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
| 6177334+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
| 1e5d96d+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
| f170ec3+dirty | 48.30 MiB | 53.57 MiB | 5.26 MiB |
| 20fbd51+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
| f3215d3+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
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.
📢 Type of change
📜 Description
Adds an experimental, opt-in API to extend the standalone app start window so work done after SDK initialization (remote config, session restore, splash-screen dismissal, etc.) is included in the app start measurement
💡 Motivation and Context
Closes #6303
Closes #5936
💚 How did you test it?
CI, Manual
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps