Title: Add API to extend app start (Android) · Issue #5553 · getsentry/sentry-java · GitHub
Open Graph Title: Add API to extend app start (Android) · Issue #5553 · getsentry/sentry-java
X Title: Add API to extend app start (Android) · Issue #5553 · getsentry/sentry-java
Description: Add an API to the Sentry Android SDK to extend the app start measurement past its default end point and instrument the extended region with child spans. // Simple: extend the app start window, then finish Sentry.extendAppStart() initiali...
Open Graph Description: Add an API to the Sentry Android SDK to extend the app start measurement past its default end point and instrument the extended region with child spans. // Simple: extend the app start window, then...
X Description: Add an API to the Sentry Android SDK to extend the app start measurement past its default end point and instrument the extended region with child spans. // Simple: extend the app start window, then...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/5553
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add API to extend app start (Android)","articleBody":"Add an API to the Sentry Android SDK to extend the app start measurement past its default end point and instrument the extended region with child spans.\n\n```kotlin\n// Simple: extend the app start window, then finish\nSentry.extendAppStart()\ninitializeRemoteConfig()\nSentry.finishExtendedAppStart()\n```\n\n```kotlin\n// With child spans: instrument the extended region\nSentry.extendAppStart()\nval span = Sentry.getExtendedAppStartSpan()\n\nval configSpan = span.startChild(\"app.init\", \"fetch remote config\")\nfetchRemoteConfig()\nconfigSpan.finish()\n\nSentry.finishExtendedAppStart()\n```\n\n**Reference:** getsentry/sentry-cocoa#6886 (Done, `SentryExtendedAppLaunchManager`). **Siblings:** getsentry/sentry-dart#3767, getsentry/sentry-react-native#6303 — shared contract, per-platform deltas below.\n\n## API\n\n* `extendAppStart(): void` — creates the extended app start span (op `app.start.extended`, description `\"Extended App Start\"`).\n* `finishExtendedAppStart` — finishes it (returns void); triggers finalization.\n* `getExtendedAppStartSpan(): ISpan` — returns the span for attaching children; a no-op span when there's no active extension.\n\n> `finishExtendedAppStart` is equivalent to calling `.finish()` on the returned span.\n\n## Lifecycle\n\n* `extendAppStart`**:** creates the span (start = call time). No-ops if app start already finished, if none is in progress, or on repeat calls (first wins).\n* `getExtendedAppStartSpan`**:** returns the extended span, else a no-op span.\n* `finishExtendedAppStart`**:** no-ops if not extended or called twice. Doesn't finalize directly — the parent (auto-generated, `waitForChildren`) finalizes when its last child finishes and trims its end to that child. Open children of the extended span are finished `cancelled` at the finish-call time.\n\n## Duration & measurement\n\n* Parent duration = end of the last child to finish (trim-to-last-child), **floored at the default app start end** — i.e. `end = max(last child end, default app start end)`. Extending can only push the end *later*; finishing before the default end keeps the default (never shorter than a non-extended app start). The extended span is just one participant.\n* App start measurement = that final duration (process start → last child), set at **finalization**. The normal completion-time measurement must be suppressed in extended mode so the early (non-extended) value doesn't win.\n\n## Timeout\n\n* Parent's auto-finish deadline is 30s. If `finishExtendedAppStart` is never called, the transaction auto-finishes on the deadline (unfinished children → `deadlineExceeded`, snapped to transaction end), is still captured, but the `app.vitals.start` measurement is suppressed — never emit a ~30s app start. Same for standalone and `ui.load`.\n\n## Standalone & non-standalone\n\n* Both supported, same mechanism: standalone uses the app-start tracer, non-standalone the `ui.load` transaction (also `waitForChildren` + deadline). In non-standalone the duration is bounded by anything keeping `ui.load` open (TTID, other children), so it can include spans unrelated to the extension.\n\n## Android delta\n\n* The span breakdown is captured natively (`ActivityLifecycleIntegration` / `AppStartMetrics`); extended launches must inherit the existing `app_start_type` tagging (getsentry/sentry-java#3989).\n* Behaviour must be identical whether standalone is opt-in or default (getsentry/sentry-java#5046, getsentry/sentry-java#5376).\n* Confirm the deadline maps onto the idle-transaction implementation, not a separate timer.\n\n## Acceptance criteria\n\n- [ ] `extendAppStart()` creates the span before finish; no-ops when too late, not started, or called repeatedly.\n- [ ] `getExtendedAppStartSpan()` returns the span, else a no-op span (including after finish).\n- [ ] Child spans render under `Extended App Start`.\n- [ ] `finishExtendedAppStart` no-ops if not extended or called twice; finalizes via `waitForChildren` with transaction end = last child.\n- [ ] Exactly one App Start transaction across all paths.\n- [ ] Measurement = process start → last child, floored at the default app start end (never shorter than a non-extended app start), set at finalization.\n- [ ] Open children at finish → `cancelled`; on deadline → `deadlineExceeded`, snapped to end.\n- [ ] Deadline path: transaction captured, `app.vitals.start` suppressed.\n- [ ] Extended app starts carry a segmentation attribute, and inherit `app_start_type` metadata.\n- [ ] Docs updated.","author":{"url":"https://github.com/buenaflor","@type":"Person","name":"buenaflor"},"datePublished":"2026-06-16T20:35:31Z","url":"https://github.com/getsentry/sentry-java/issues/5553"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7e222175-0959-f10a-e0bb-52b686118b56 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CFB2:3C88CA:3F31A3:572238:6B046DA7 |
| html-safe-nonce | 9d0622ea65557838e377731e7f59f9e4df5364d9841ab2273705ffe0197cf0af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkIyOjNDODhDQTozRjMxQTM6NTcyMjM4OjZCMDQ2REE3IiwidmlzaXRvcl9pZCI6IjE5NzM1ODUwNjI1NDUwOTIwMDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1d6060b468c250b572d4e0395b2d6bec597509e3e57af2a71f60367c3068d2a8 |
| hovercard-subject-tag | issue:4677710711 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/5553/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f744e47dc778139a200b068baba8eb10722264d966be9ee1d0a9aff1b3eb4da2/getsentry/sentry-java/issues/5553 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f744e47dc778139a200b068baba8eb10722264d966be9ee1d0a9aff1b3eb4da2/getsentry/sentry-java/issues/5553 |
| og:image:alt | Add an API to the Sentry Android SDK to extend the app start measurement past its default end point and instrument the extended region with child spans. // Simple: extend the app start window, then... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | buenaflor |
| hostname | github.com |
| expected-hostname | github.com |
| None | ae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cfb5f24c6e01d85f70804652a5107e5cac03a161 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width