Skip to content

feat(core): [Logs and Metrics Enable Flags 12] Remove Metrics enable flag - #5953

Open
adinauer wants to merge 3 commits into
perf/logs-batch-thread-first-usefrom
feat/remove-metrics-enable-flag
Open

feat(core): [Logs and Metrics Enable Flags 12] Remove Metrics enable flag#5953
adinauer wants to merge 3 commits into
perf/logs-batch-thread-first-usefrom
feat/remove-metrics-enable-flag

Conversation

@adinauer

@adinauer adinauer commented Aug 13, 2026

Copy link
Copy Markdown
Member

PR Stack (Logs and Metrics Enable Flags)


📜 Description

Removes the aggregate Metrics enable option from SentryOptions.Metrics. Manual Sentry.metrics() calls now capture without an enable flag, and SentryClient always creates the configured Metrics batch processor.

Legacy metrics.enabled external configuration and io.sentry.metrics.enabled Android metadata remain detectable for follow-up migration warnings, but their values are no longer applied. NoOpMetricsBatchProcessor remains available as a separate public API.

💡 Motivation and Context

Metrics are a manual namespaced API and no production integration currently generates them automatically. Requiring an aggregate enable option adds configuration without protecting users from automatic instrumentation.

💚 How did you test it?

  • ./gradlew :sentry:test :sentry-android-core:testReleaseUnitTest
  • ./gradlew spotlessApply apiDump
  • Verified explicit legacy external and Android false values do not disable capture
  • Verified the configured Metrics batch processor is always created
  • Verified the removed methods disappear from the core API dump

📝 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

Add an Android migration warning for explicit legacy io.sentry.metrics.enabled metadata.

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

@github-actions

github-actions Bot commented Aug 13, 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 ab38817

@sentry

sentry Bot commented Aug 13, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

Capture manual Metrics without an aggregate option and always create the configured batch processor. Keep legacy external and Android keys only for subsequent migration warnings.

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

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 312.54 ms 354.06 ms 41.52 ms
Size 0 B 0 B 0 B

Baseline results on branch: perf/logs-batch-thread-first-use

Startup times

Revision Plain With Sentry Diff
31a945a 307.74 ms 351.86 ms 44.11 ms

App size

Revision Plain With Sentry Diff
31a945a 0 B 0 B 0 B

Previous results on branch: feat/remove-metrics-enable-flag

Startup times

Revision Plain With Sentry Diff
aceb315 315.40 ms 346.49 ms 31.09 ms

App size

Revision Plain With Sentry Diff
aceb315 0 B 0 B 0 B

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.

1 participant