Skip to content

feat(android): Enable standalone app start tracing by default - #6716

Open
runningcode wants to merge 3 commits into
9.x.xfrom
no/java-503-standalone-app-start-default
Open

runningcode wants to merge 3 commits into
9.x.xfrom
no/java-503-standalone-app-start-default

Conversation

@runningcode

@runningcode runningcode commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Turn on standalone app start tracing by default in 9.0.

That means the app start is now sent as its own App Start transaction (app.start) instead of an app.start.* child span of the first ui.load transaction.

The option and the io.sentry.standalone-app-start-tracing.enable manifest key stay, so apps can opt out with false. The option is no longer @ApiStatus.Experimental.

Things worth a look:

  • UI tests run with the new default.
  • Hybrid SDKs: React Native, Flutter and Capacitor don't enable native tracing on Android, so this is a no-op for them. .NET MAUI does when Native.EnableTracing is on (off by default), and then its apps get the standalone transaction too.

💡 Motivation and Context

💚 How did you test it?

Unit tests in sentry-android-core, and the sentry-uitest-android suite on an emulator.

📝 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.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Update the Android tracing docs, which still describe the option as opt-in, when 9.0 ships.

🤖 Generated with Claude Code

App start is now sent as its own App Start transaction instead of an
app.start.* child span of the first ui.load transaction. The option and
its manifest key stay so apps can opt out, and the option is no longer
experimental.

AppStartMetrics.clear() now also drops the extend-app-start listener, which
otherwise leaks from one ActivityLifecycleIntegrationTest into the next
now that most tests register it.

Fixes JAVA-503
Fixes #5376

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 20, 2026

Copy link
Copy Markdown

JAVA-503

@github-actions

github-actions Bot commented Nov 20, 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 a151e1b

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 20, 2026
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit a151e1b.

Main concerns: public contract, data sent to Sentry, reach.

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode marked this pull request as ready for review November 20, 2026 15:31
@runningcode
runningcode requested review from a team and adinauer as code owners November 20, 2026 15:31
@runningcode
runningcode requested review from 0xadam-brown and romtsn and removed request for a team November 20, 2026 15:31
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 20, 2026

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

Stale Bugbot comment from a previous run.

@Test
fun `extendAppStart is a no-op when standalone tracing is disabled`() {
val sut = fixture.getSut { it.tracesSampleRate = 1.0 }
val sut = fixture.getSut {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test assumes one ui.load transaction

Medium Severity

This test calls setAppStartTime() without disabling isEnableStandaloneAppStartTracing. With the new default, onActivityCreated starts both an app.start and a ui.load transaction, so the implicit single-call verify on startTransaction (and the ui.load op check) no longer holds. Nearby child-span tests were updated; this one was not.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bugbot

Reviewed by Cursor Bugbot for commit 6f0879b. Configure here.

Instead of turning the new default off for all UI tests, MockRelay keeps
app start transactions apart. They don't count as expected requests and
don't use up custom responses, since whether a headless app start is sent
depends on the process importance. Tests that launch an Activity assert
exactly one app start transaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 20, 2026

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a151e1b. Configure here.

transaction2.finish()

relay.assert {
assertAppStartTransaction()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

App start assert races with re-init

Medium Severity

doubleInitWithSameOptionsDoesNotThrow now requires exactly one App Start envelope, but it re-inits Sentry immediately after launchActivity. App start is often finished on first frame, which can still be pending after RESUMED, and MockRelay never counts those envelopes toward idling. assertAppStartTransaction() then fails when the list is empty, or if a delayed headless start arrives as well.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by project rule: AGENTS.md

Reviewed by Cursor Bugbot for commit a151e1b. Configure here.

Comment thread CHANGELOG.md
- Remove the Android `enablePerformanceV2` option and its `io.sentry.performance-v2.enable` manifest metadata. Performance V2 is always on ([#6458](https://github.com/getsentry/sentry-java/pull/6458))
- App starts are measured from process start on Android 7.0+ (API 24), and slow and frozen frames are measured per span
- `ActivityFramesTracker` is removed, and the `ActivityLifecycleIntegration` constructor no longer takes it
- Enable standalone app start tracing on Android by default. App start is sent as its own `App Start` transaction instead of an `app.start.*` child span of the first `ui.load` transaction. More accurate app launch tracking, resulting in higher span consumption on Android. To keep the previous behavior, set `options.isEnableStandaloneAppStartTracing = false` or the `io.sentry.standalone-app-start-tracing.enable` manifest metadata to `false` ([#6716](https://github.com/getsentry/sentry-java/pull/6716))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Enable standalone app start tracing on Android by default. App start is sent as its own `App Start` transaction instead of an `app.start.*` child span of the first `ui.load` transaction. More accurate app launch tracking, resulting in higher span consumption on Android. To keep the previous behavior, set `options.isEnableStandaloneAppStartTracing = false` or the `io.sentry.standalone-app-start-tracing.enable` manifest metadata to `false` ([#6716](https://github.com/getsentry/sentry-java/pull/6716))
- Enable standalone app start tracing on Android by default. App start is sent as its own `App Start` transaction instead of an `app.start.*` child span of the first `ui.load` transaction. More accurate app launch tracking, resulting in higher span quota consumption on Android. To keep the previous behavior, set `options.isEnableStandaloneAppStartTracing = false` or the `io.sentry.standalone-app-start-tracing.enable` manifest metadata to `false` ([#6716](https://github.com/getsentry/sentry-java/pull/6716))

This branch has not been deployed

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

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants