Skip to content

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

Merged
adinauer merged 10 commits into
feat/logs-metrics-enable-flagsfrom
feat/remove-metrics-enable-flag
Oct 9, 2026
Merged

adinauer merged 10 commits into
feat/logs-metrics-enable-flagsfrom
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.

Removes legacy metrics.enabled external configuration and io.sentry.metrics.enabled Android metadata. 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 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

Avoid starting the Metrics batch worker thread until it is first needed.

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

@github-actions

github-actions Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor
Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- [Logs and Metrics Enable Flags 9] Remove Metrics enable flag ([#5953](https://github.com/getsentry/sentry-java/pull/5953))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against a1e848a

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

@adinauer
adinauer marked this pull request as ready for review August 13, 2026 13:41

@lbloder lbloder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 👍

adinauer and others added 4 commits September 29, 2026 16:05
# Conflicts:
#	sentry-android-core/src/test/java/io/sentry/android/core/ManifestMetadataReaderTest.kt
# Conflicts:
#	sentry/src/main/java/io/sentry/SentryOptions.java
#	sentry/src/test/java/io/sentry/SentryOptionsTest.kt
Remove obsolete external and Android manifest parsing retained only for
migration warnings that will not ship in v9.

Co-Authored-By: Claude <noreply@anthropic.com>
@adinauer adinauer changed the title feat(core): [Logs and Metrics Enable Flags 12] Remove Metrics enable flag feat(core): [Logs and Metrics Enable Flags 9] Remove Metrics enable flag Sep 30, 2026
@lbloder

lbloder commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Do we still need the NoOpMetricsBatchProcessor?

adinauer and others added 2 commits October 9, 2026 11:35
Propagate the updated Logs enable-flag removal through the stack while
preserving branch ancestry.
Remove the internal no-op batch processor now that SentryClient always
creates the configured Metrics processor and no SDK path selects the stub.

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

adinauer commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Removed NoOpMetricsBatchProcessor in a1e848a. It had no remaining SDK call sites after removing the aggregate Metrics enable flag; supported suppression remains available through beforeSendMetric.

Base automatically changed from perf/logs-batch-thread-first-use to feat/logs-metrics-enable-flags October 9, 2026 09:43
@adinauer
adinauer merged commit 98074e6 into feat/logs-metrics-enable-flags Oct 9, 2026
64 of 66 checks passed
@adinauer
adinauer deleted the feat/remove-metrics-enable-flag branch October 9, 2026 09:43
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