Skip to content

feat(core): Remove Logs and Metrics enable flags - #5939

Draft
adinauer wants to merge 136 commits into
9.x.xfrom
feat/logs-metrics-enable-flags
Draft

adinauer wants to merge 136 commits into
9.x.xfrom
feat/logs-metrics-enable-flags

Conversation

@adinauer

@adinauer adinauer commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Logs and Metrics Enable Flags)


📜 Description

Collection PR for the Logs and Metrics enable-flag removal stack. Squash-merge this once all stack PRs are merged.

💡 Motivation and Context

Removes the aggregate Logs and Metrics enable flags, adds integration-local Logs opt-ins, and avoids starting unused batch worker threads.

💚 How did you test it?

Each PR in the stack includes focused tests. The completed stack will run the full repository checks and aggregate Javadocs.

📝 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

Merge each stack PR into this collection branch in order using merge commits, then squash-merge this PR into 9.x.x.

@github-actions

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

- Remove Logs and Metrics enable flags ([#5939](https://github.com/getsentry/sentry-java/pull/5939))

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 cd8fe1f

@sentry

sentry Bot commented Aug 12, 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

Require an explicit Logback appender opt-in before forwarding records as Sentry Logs. Keep event and breadcrumb capture independent while the aggregate core Logs flag remains in place.

Co-Authored-By: Claude <noreply@anthropic.com>
adinauer and others added 2 commits August 12, 2026 15:54
Require an explicit Log4j2 appender opt-in before forwarding records as Sentry Logs. Preserve existing constructors and factory methods with Logs disabled by default while keeping events and breadcrumbs unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
adinauer and others added 2 commits August 12, 2026 16:02
Require an explicit JUL handler opt-in before forwarding records as Sentry Logs. Support Java and LogManager configuration while keeping event and breadcrumb capture unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
adinauer and others added 2 commits August 12, 2026 16:07
Require an explicit Timber-local opt-in before forwarding Timber messages as Sentry Logs. Add Android options and manifest configuration for auto-installed integrations while preserving event and breadcrumb capture.

Co-Authored-By: Claude <noreply@anthropic.com>
adinauer and others added 2 commits August 12, 2026 16:21
Require an explicit Android option before forwarding Logcat calls as Sentry Logs. Support Java and manifest configuration while keeping breadcrumbs and Android Log calls unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
adinauer and others added 2 commits August 12, 2026 16:29
Add a Spring Boot logging property that controls Sentry Logs forwarding from auto-configured Logback appenders. Keep appender installation, events, and breadcrumbs independent from the new opt-in.

Co-Authored-By: Claude <noreply@anthropic.com>
adinauer and others added 2 commits August 12, 2026 16:35
Capture manual Sentry Logs without an aggregate enable option and always create the configured logger batch processor. Keep automatic logging integrations controlled by their local opt-ins and remove legacy Logs configuration from active samples and fixtures.

Co-Authored-By: Claude <noreply@anthropic.com>
adinauer and others added 2 commits August 12, 2026 16:44
Detect explicit io.sentry.logs.enabled Android manifest metadata and emit tailored migration warnings without changing the integration-local Logs options.

Co-Authored-By: Claude <noreply@anthropic.com>
Keep parsing the nullable logs.enabled external option and emit tailored migration warnings for explicit true and false values without changing manual Logs capture.

Co-Authored-By: Claude <noreply@anthropic.com>
Inspect the Spring Environment before SDK initialization and emit tailored migration warnings for explicit sentry.logs.enabled values without binding or applying the obsolete property.

Co-Authored-By: Claude <noreply@anthropic.com>
adinauer and others added 7 commits September 30, 2026 14:59
Skip resource-bundle lookup and message formatting when a JUL record has no message. Preserve event and breadcrumb capture instead of aborting with a null-pointer exception.

Co-Authored-By: Claude <noreply@anthropic.com>
State that options such as sampling should only be added when the signal supports them. Avoid implying that Logs and Metrics currently expose sampling controls.

Co-Authored-By: Claude <noreply@anthropic.com>
Hide the lazy evaluator constructor from the supported Kotlin API while
retaining Java access for Android integration wiring. Use a lambda instead
of a method reference for compatibility with older Android Gradle plugins.

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

linear-code Bot commented Oct 2, 2026

Copy link
Copy Markdown

JAVA-768

adinauer and others added 21 commits October 9, 2026 11:10
feat(logback): [Logs and Metrics Enable Flags 1] Add Logs opt-in
feat(log4j2): [Logs and Metrics Enable Flags 2] Add Logs opt-in
feat(jul): [Logs and Metrics Enable Flags 3] Add Logs opt-in
feat(android): [Logs and Metrics Enable Flags 4] Add Timber Logs opt-in
feat(android): [Logs and Metrics Enable Flags 5] Add Logcat Logs opt-in
feat(spring): [Logs and Metrics Enable Flags 6] Add logging Logs opt-in for Spring Boot
Remove the internal no-op batch processor now that SentryClient always
creates the configured Logs processor and no SDK path selects the stub.

Co-Authored-By: Claude <noreply@anthropic.com>
Propagate removal of the unused no-op Logs batch processor through the
stack while preserving branch ancestry.
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>
Propagate removal of unused no-op telemetry batch processors through the
stack while preserving branch ancestry.
Propagate removal of unused no-op telemetry batch processors through the
stack while preserving branch ancestry.
Propagate removal of unused no-op telemetry batch processors through the
stack while preserving branch ancestry.
Propagate removal of unused no-op telemetry batch processors through the
stack while preserving branch ancestry.
feat(core): [Logs and Metrics Enable Flags 7] Remove Logs enable flag
perf(core): [Logs and Metrics Enable Flags 8] Avoid unused Logs worker thread
feat(core): [Logs and Metrics Enable Flags 9] Remove Metrics enable flag
…st-use

perf(core): [Logs and Metrics Enable Flags 10] Avoid unused Metrics worker thread
fix(jul): [Logs and Metrics Enable Flags 11] Preserve null-message records
docs: [Logs and Metrics Enable Flags 12] Update options guidance
fix(android): [Logs and Metrics Enable Flags 13] Read Timber option lazily

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant