Skip to content

feat(extend-app-start): [4/4] Add public Sentry app start extension API#5628

Open
buenaflor wants to merge 8 commits into
feat/app-start-extension-materializefrom
feat/app-start-extension-api
Open

feat(extend-app-start): [4/4] Add public Sentry app start extension API#5628
buenaflor wants to merge 8 commits into
feat/app-start-extension-materializefrom
feat/app-start-extension-api

Conversation

@buenaflor

@buenaflor buenaflor commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

PR Stack (Extend App Start)


📜 Description

Adds the public static facade for the app start extension API — the only PR in the stack that adds public API surface. Each method is a thin bridge to getCurrentScopes().getOptions().getAppStartExtender() (the IAppStartExtender from [1/4]), mirroring Sentry.reportFullyDisplayed().

Method Purpose
Sentry.extendAppStart() Begin extending the app start (call from Application.onCreate, right after SentryAndroid.init).
Sentry.getExtendedAppStartSpan() The extended ISpan to attach child spans to — or a NoOpSpan when no extension is active.
Sentry.finishExtendedAppStart() Finish the extension, letting the app start transaction complete.

No-op when the SDK is disabled, on platforms without an app start extender, or when standalone app start tracing is off.

Also adds a usage example to the Android sample (MyApplication): extendAppStart(), child spans under getExtendedAppStartSpan(), then finishExtendedAppStart().

💡 Motivation and Context

Fourth and final PR of the app start extension API stack (#5553), which lets apps extend the app start measurement to cover extra launch-time work — e.g. loading remote config before the first screen (mirrors sentry-cocoa's extendAppLaunch() / finishExtendedAppLaunch()).

💚 How did you test it?

SentryTest verifies the three methods delegate to options.getAppStartExtender(), and that the API returns a no-op span / no-ops when the SDK is disabled. apiCheck, spotless, and the :sentry unit suite pass; the sample module compiles.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Final PR of the stack. Once the stack is merged up, the collection branch (#5604) squash-merges into main.

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

#skip-changelog

@github-actions

github-actions Bot commented Jun 25, 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 caa7945

@sentry

sentry Bot commented Jun 25, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.44.1 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 307.35 ms 362.96 ms 55.61 ms
Size 0 B 0 B 0 B

Baseline results on branch: feat/app-start-extension-materialize

Startup times

Revision Plain With Sentry Diff
4cf89ba 340.51 ms 416.92 ms 76.41 ms
4451634 321.21 ms 376.21 ms 55.00 ms
20bbe9a 305.48 ms 387.25 ms 81.77 ms
69caaee 313.73 ms 373.92 ms 60.19 ms

App size

Revision Plain With Sentry Diff
4cf89ba 0 B 0 B 0 B
4451634 0 B 0 B 0 B
20bbe9a 0 B 0 B 0 B
69caaee 0 B 0 B 0 B

Previous results on branch: feat/app-start-extension-api

Startup times

Revision Plain With Sentry Diff
d35892b 313.39 ms 367.63 ms 54.25 ms
097718d 323.29 ms 363.42 ms 40.13 ms

App size

Revision Plain With Sentry Diff
d35892b 0 B 0 B 0 B
097718d 0 B 0 B 0 B

@buenaflor buenaflor force-pushed the feat/app-start-extension-materialize branch from 5dfb0e1 to 0bd259a Compare June 25, 2026 09:59
@buenaflor buenaflor force-pushed the feat/app-start-extension-api branch from bd89a68 to 90684a2 Compare June 25, 2026 10:00
@buenaflor buenaflor force-pushed the feat/app-start-extension-materialize branch from 0bd259a to 0b6ada0 Compare June 25, 2026 11:07
@buenaflor buenaflor force-pushed the feat/app-start-extension-api branch from 90684a2 to 51ca64a Compare June 25, 2026 11:07
@buenaflor buenaflor force-pushed the feat/app-start-extension-materialize branch from 0b6ada0 to 9e6f0a0 Compare June 25, 2026 11:38
@buenaflor buenaflor force-pushed the feat/app-start-extension-api branch from 51ca64a to 4c3438c Compare June 25, 2026 11:38
@buenaflor buenaflor force-pushed the feat/app-start-extension-materialize branch from 9e6f0a0 to 976c29a Compare June 25, 2026 12:10
@buenaflor buenaflor force-pushed the feat/app-start-extension-api branch from 4c3438c to 93464ef Compare June 25, 2026 12:10
@buenaflor buenaflor force-pushed the feat/app-start-extension-materialize branch from 976c29a to ac7a577 Compare June 25, 2026 12:17
@buenaflor buenaflor force-pushed the feat/app-start-extension-api branch from 93464ef to a4baf22 Compare June 25, 2026 12:17
@buenaflor buenaflor force-pushed the feat/app-start-extension-materialize branch from ac7a577 to c3f3627 Compare June 25, 2026 12:18
@buenaflor buenaflor force-pushed the feat/app-start-extension-api branch from a4baf22 to c559b65 Compare June 25, 2026 12:18
@buenaflor buenaflor force-pushed the feat/app-start-extension-materialize branch from c3f3627 to cbaef2f Compare June 25, 2026 12:23
@buenaflor buenaflor force-pushed the feat/app-start-extension-api branch from c559b65 to 50357a5 Compare June 25, 2026 12:23
Static bridge delegating to options.getAppStartExtender(): extendAppStart(),
finishAppStart(), getExtendedAppStartSpan(). No-op when the SDK is disabled or the
platform provides no app start extender. Completes the extend app start feature (4/4).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@buenaflor buenaflor force-pushed the feat/app-start-extension-materialize branch from cbaef2f to d996425 Compare June 25, 2026 12:32
@buenaflor buenaflor force-pushed the feat/app-start-extension-api branch from 50357a5 to 4349a42 Compare June 25, 2026 12:32
@buenaflor buenaflor marked this pull request as ready for review June 25, 2026 15:27
Copilot AI review requested due to automatic review settings June 25, 2026 15:27

Copilot AI 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.

Pull request overview

Adds a public static facade on io.sentry.Sentry for the Android app start extension feature, exposing a small public API surface that delegates to the internally-wired IAppStartExtender in SentryOptions.

Changes:

  • Added Sentry.extendAppStart(), Sentry.finishExtendedAppStart(), and Sentry.getExtendedAppStartSpan() as public entry points delegating to getCurrentScopes().getOptions().getAppStartExtender().
  • Added unit tests ensuring the new methods delegate correctly and remain no-ops when the SDK is disabled.
  • Added an Android sample usage demonstrating extending app start and creating child spans under the extended app start span.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
sentry/src/main/java/io/sentry/Sentry.java Introduces the new public facade methods and Javadoc for the app start extension API.
sentry/src/test/java/io/sentry/SentryTest.kt Adds delegation + disabled-SDK no-op coverage for the new public facade methods.
sentry/api/sentry.api Updates the API surface dump to include the newly added Sentry methods.
sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/MyApplication.java Demonstrates intended usage of the new API in the Android sample app.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants