Skip to content

ref(android): Remove the enablePerformanceV2 option - #6458

Open
runningcode wants to merge 2 commits into
9.x.xfrom
no/drop-enableperformancev2-flag
Open

runningcode wants to merge 2 commits into
9.x.xfrom
no/drop-enableperformancev2-flag

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

Removes the enablePerformanceV2 option and its io.sentry.performance-v2.enable manifest key. Performance V2 is now always on.

With the flag gone, the v1 code paths can't run anymore, so this also deletes them:

  • ActivityFramesTracker, the v1 slow/frozen frames tracker built on androidx FrameMetricsAggregator. It already no-oped whenever V2 was on. SpanFrameMetricsCollector is now always registered and records frame measurements per span.
  • The ActivityFramesTracker parameter on ActivityLifecycleIntegration's public constructor, PerformanceAndroidEventProcessor and the AndroidOptionsInitializer plumbing.
  • The SentryAndroidOptions parameter on AppStartMetrics.getAppStartTimeSpanWithFallback, which only read the flag.
  • The ProGuard keep rule for FrameMetricsAggregator.

App starts are always measured from process start on API 24+. Below API 24 they still fall back to SDK init time, like before.

💡 Motivation and Context

The flag has defaulted to true for a long time, and we don't expect anyone to turn it off. Dropping it in the 9.0 major removes a configuration surface and about 1,200 lines of v1 code and tests.

GitHub code search found no use of ActivityFramesTracker, getAppStartTimeSpanWithFallback or the flag in the hybrid SDKs.

💚 How did you test it?

  • Removed the tests that only covered the v1 path or the deleted tracker.
  • Added a test that SpanFrameMetricsCollector is registered by default.
  • Reworked foreground standalone app start measurement uses foreground fallback time span, which relied on V2 being off. It now uses an app start span longer than the one-minute cap, so the foreground fallback to SDK init time is still covered.
  • if app is launched in background, appStartTimeSpanWithFallback returns an empty span only passed through the v1 path. It created an activity, and since then an activity created after a background launch starts a new warm start. V1 ignored that restarted span. The test now checks the background launch without an activity, and the next test already covers the warm start.
  • Merged the two AutomaticSpansTest frames UI tests (V2 on and off) into one.
  • Ran the affected sentry-android-core unit tests locally.

📝 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 docs in sentry-docs: tracing/instrumentation/perf-v2.mdx still shows how to enable the option, and features/index.mdx and automatic-instrumentation.mdx link to it.

🤖 Generated with Claude Code

Performance V2 has defaulted to on for a long time, so 9.0 drops the
option and its io.sentry.performance-v2.enable manifest key.

Without the flag the v1 paths can't run, so remove them too: the
FrameMetricsAggregator-based ActivityFramesTracker, its constructor
parameters, and the options parameter of
AppStartMetrics.getAppStartTimeSpanWithFallback. SpanFrameMetricsCollector
is now always registered.

Fixes JAVA-527
Fixes #5472

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

linear-code Bot commented Nov 4, 2026

Copy link
Copy Markdown

JAVA-527

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java

1 similar comment
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry-android-core/src/main/java/io/sentry/android/core/InternalSentrySdk.java

@sentry

sentry Bot commented Nov 4, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode marked this pull request as ready for review November 4, 2026 14:34
@runningcode runningcode added the ship-it PR is ready to merge from a reviewer perspective label Nov 4, 2026

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

ship-it PR is ready to merge from a reviewer perspective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant