Skip to content

feat(tracing): Add extend app start API for standalone app start#6392

Open
antonis wants to merge 9 commits into
mainfrom
antonis/rn-675-add-api-to-extend-app-start-react-native
Open

feat(tracing): Add extend app start API for standalone app start#6392
antonis wants to merge 9 commits into
mainfrom
antonis/rn-675-add-api-to-extend-app-start-react-native

Conversation

@antonis

@antonis antonis commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • New feature
  • Enhancement

📜 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

🔮 Next steps

…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>
@linear-code

linear-code Bot commented Jul 2, 2026

Copy link
Copy Markdown

RN-675

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(tracing): Add extend app start API for standalone app start by antonis in #6392

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against c8be3b7

Comment thread CHANGELOG.md Outdated
Comment thread packages/core/src/js/tracing/integrations/appStart.ts
Comment thread packages/core/src/js/tracing/integrations/appStart.ts
Comment thread packages/core/src/js/tracing/integrations/appStart.ts
Comment thread packages/core/src/js/tracing/integrations/appStart.ts Outdated
Comment thread packages/core/src/js/tracing/integrations/appStart.ts Outdated
Comment thread packages/core/etc/sentry-react-native.api.md
Comment thread packages/core/src/js/sdk.tsx
Comment thread packages/core/src/js/tracing/integrations/appStart.ts
antonis and others added 2 commits July 2, 2026 14:49
- 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>
Comment thread packages/core/src/js/tracing/integrations/appStart.ts
Comment thread packages/core/src/js/tracing/integrations/appStart.ts Outdated
antonis and others added 2 commits July 2, 2026 15:03
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>
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Jul 2, 2026
@antonis antonis changed the title feat(tracing): Add extend app start API for standalone app start (RN-675) feat(tracing): Add extend app start API for standalone app start Jul 2, 2026
@sentry

sentry Bot commented Jul 2, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.17.2 (97) Release

⚙️ sentry-react-native Build Distribution Settings

@antonis

antonis commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@sentry review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3828.71 ms 1210.06 ms -2618.64 ms
Size 4.98 MiB 6.51 MiB 1.54 MiB

Baseline results on branch: main

Startup times

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

Previous results on branch: antonis/rn-675-add-api-to-extend-app-start-react-native

Startup times

Revision Plain With Sentry Diff
e31550e+dirty 3813.85 ms 1219.14 ms -2594.71 ms

App size

Revision Plain With Sentry Diff
e31550e+dirty 4.98 MiB 6.51 MiB 1.54 MiB

antonis and others added 2 commits July 2, 2026 16:04
…ased

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3823.62 ms 1214.21 ms -2609.40 ms
Size 4.98 MiB 6.51 MiB 1.54 MiB

Baseline results on branch: main

Startup times

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

Previous results on branch: antonis/rn-675-add-api-to-extend-app-start-react-native

Startup times

Revision Plain With Sentry Diff
e31550e+dirty 3844.98 ms 1223.57 ms -2621.41 ms

App size

Revision Plain With Sentry Diff
e31550e+dirty 4.98 MiB 6.51 MiB 1.54 MiB

@antonis antonis marked this pull request as ready for review July 2, 2026 15:06
@antonis antonis requested review from a team, alwx and lucas-zimerman as code owners July 2, 2026 15:06
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 543.02 ms 561.87 ms 18.85 ms
Size 49.74 MiB 55.09 MiB 5.35 MiB

Baseline results on branch: main

Startup times

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

Previous results on branch: antonis/rn-675-add-api-to-extend-app-start-react-native

Startup times

Revision Plain With Sentry Diff
e31550e+dirty 454.83 ms 522.62 ms 67.80 ms

App size

Revision Plain With Sentry Diff
e31550e+dirty 49.74 MiB 55.09 MiB 5.35 MiB

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 431.96 ms 450.28 ms 18.32 ms
Size 49.74 MiB 55.09 MiB 5.35 MiB

Baseline results on branch: main

Startup times

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

Previous results on branch: antonis/rn-675-add-api-to-extend-app-start-react-native

Startup times

Revision Plain With Sentry Diff
e31550e+dirty 512.54 ms 588.48 ms 75.94 ms

App size

Revision Plain With Sentry Diff
e31550e+dirty 49.74 MiB 55.09 MiB 5.35 MiB

@lucas-zimerman

Copy link
Copy Markdown
Collaborator

Shouldn't this mark other ppl to review the API changes?
Also since they are not new APIs, I am fine not tagging others tood.

Other than that LGTM!

@antonis antonis requested a review from buenaflor July 6, 2026 15:28
@antonis

antonis commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Shouldn't this mark other ppl to review the API changes?

@buenaflor Added you as a reviewer on the public api changes since you already have context on the project 🙇

@buenaflor buenaflor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public API changes look good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Triggers the full CI test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add API to extend app start (React Native) app.start.cold / app.start.warm → allow nesting; or make it be controlled somehow

3 participants