feat(tracing): Add extend app start API for standalone app start#6392
feat(tracing): Add extend app start API for standalone app start#6392antonis wants to merge 9 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>
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. |
|
- 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
|
|
@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.
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3b6e9f9+dirty | 3851.90 ms | 1233.33 ms | -2618.57 ms |
| 71abba0+dirty | 3821.93 ms | 1202.81 ms | -2619.12 ms |
| 57e0069+dirty | 3842.29 ms | 1212.12 ms | -2630.17 ms |
| 7a89652+dirty | 3861.46 ms | 1229.61 ms | -2631.85 ms |
| 0b1b5e3+dirty | 3823.96 ms | 1220.12 ms | -2603.84 ms |
| 3ce5254+dirty | 1219.93 ms | 1221.90 ms | 1.96 ms |
| 5a23c47+dirty | 3855.46 ms | 1221.95 ms | -2633.50 ms |
| 44c8b3f+dirty | 3823.85 ms | 1207.66 ms | -2616.19 ms |
| 4953e94+dirty | 1212.06 ms | 1214.83 ms | 2.77 ms |
| 04207c4+dirty | 1191.27 ms | 1189.78 ms | -1.48 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3b6e9f9+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 71abba0+dirty | 5.15 MiB | 6.67 MiB | 1.52 MiB |
| 57e0069+dirty | 4.98 MiB | 6.50 MiB | 1.52 MiB |
| 7a89652+dirty | 5.15 MiB | 6.70 MiB | 1.55 MiB |
| 0b1b5e3+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 3ce5254+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| 5a23c47+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| 44c8b3f+dirty | 5.15 MiB | 6.66 MiB | 1.51 MiB |
| 4953e94+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 04207c4+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
…i-to-extend-app-start-react-native
…ased Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 57e0069+dirty | 3842.23 ms | 1210.00 ms | -2632.23 ms |
| 5125c43+dirty | 3827.94 ms | 1208.79 ms | -2619.15 ms |
| 580fb5c+dirty | 3835.45 ms | 1218.61 ms | -2616.84 ms |
| 7887847+dirty | 3844.89 ms | 1221.67 ms | -2623.22 ms |
| a5d243c+dirty | 3827.92 ms | 1220.10 ms | -2607.81 ms |
| f170ec3+dirty | 3844.74 ms | 1222.67 ms | -2622.07 ms |
| 68672fc+dirty | 3832.22 ms | 1228.29 ms | -2603.93 ms |
| ae37560+dirty | 3840.10 ms | 1217.89 ms | -2622.21 ms |
| e763471+dirty | 3826.10 ms | 1221.52 ms | -2604.58 ms |
| 2c735cc+dirty | 1223.33 ms | 1224.38 ms | 1.04 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 57e0069+dirty | 4.98 MiB | 6.50 MiB | 1.52 MiB |
| 5125c43+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| 580fb5c+dirty | 4.98 MiB | 6.46 MiB | 1.48 MiB |
| 7887847+dirty | 4.98 MiB | 6.46 MiB | 1.48 MiB |
| a5d243c+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| f170ec3+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| 68672fc+dirty | 5.15 MiB | 6.71 MiB | 1.55 MiB |
| ae37560+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| e763471+dirty | 4.98 MiB | 6.51 MiB | 1.53 MiB |
| 2c735cc+dirty | 3.38 MiB | 4.74 MiB | 1.35 MiB |
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eb93136+dirty | 500.37 ms | 532.58 ms | 32.21 ms |
| ae37560+dirty | 428.96 ms | 456.86 ms | 27.90 ms |
| 5c1e987+dirty | 444.71 ms | 475.13 ms | 30.42 ms |
| 5b7e8a7+dirty | 601.58 ms | 634.98 ms | 33.40 ms |
| c823bb5+dirty | 468.26 ms | 516.16 ms | 47.90 ms |
| 5a23c47+dirty | 406.83 ms | 451.47 ms | 44.64 ms |
| e763471+dirty | 538.31 ms | 574.44 ms | 36.13 ms |
| 7887847+dirty | 420.47 ms | 460.55 ms | 40.08 ms |
| acd838e+dirty | 492.90 ms | 551.42 ms | 58.52 ms |
| 6177334+dirty | 404.80 ms | 456.74 ms | 51.94 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| eb93136+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| ae37560+dirty | 48.30 MiB | 53.60 MiB | 5.29 MiB |
| 5c1e987+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| 5b7e8a7+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| c823bb5+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 5a23c47+dirty | 49.74 MiB | 54.82 MiB | 5.07 MiB |
| e763471+dirty | 49.74 MiB | 54.85 MiB | 5.11 MiB |
| 7887847+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
| acd838e+dirty | 48.30 MiB | 53.60 MiB | 5.30 MiB |
| 6177334+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5b7e8a7+dirty | 418.55 ms | 488.46 ms | 69.91 ms |
| eb93136+dirty | 416.18 ms | 467.32 ms | 51.14 ms |
| 4e0b819+dirty | 420.56 ms | 470.08 ms | 49.52 ms |
| 3b6e9f9+dirty | 442.70 ms | 486.44 ms | 43.74 ms |
| c823bb5+dirty | 409.87 ms | 478.57 ms | 68.70 ms |
| ecf47a2+dirty | 420.40 ms | 458.02 ms | 37.62 ms |
| 88735e9+dirty | 429.04 ms | 484.17 ms | 55.13 ms |
| ef27341+dirty | 412.94 ms | 443.98 ms | 31.04 ms |
| e763471+dirty | 426.57 ms | 458.21 ms | 31.64 ms |
| 0d9949d+dirty | 403.57 ms | 437.00 ms | 33.43 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 5b7e8a7+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| eb93136+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| 4e0b819+dirty | 49.74 MiB | 54.81 MiB | 5.07 MiB |
| 3b6e9f9+dirty | 48.30 MiB | 53.54 MiB | 5.23 MiB |
| c823bb5+dirty | 48.30 MiB | 53.58 MiB | 5.28 MiB |
| ecf47a2+dirty | 49.74 MiB | 54.82 MiB | 5.07 MiB |
| 88735e9+dirty | 49.74 MiB | 54.82 MiB | 5.07 MiB |
| ef27341+dirty | 48.30 MiB | 53.54 MiB | 5.24 MiB |
| e763471+dirty | 49.74 MiB | 54.85 MiB | 5.11 MiB |
| 0d9949d+dirty | 43.75 MiB | 48.13 MiB | 4.37 MiB |
|
Shouldn't this mark other ppl to review the API changes? Other than that LGTM! |
@buenaflor Added you as a reviewer on the public api changes since you already have context on the project 🙇 |
buenaflor
left a comment
There was a problem hiding this comment.
Public API changes look good to me 👍
📢 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