Skip to content

feat(spring): [Logs and Metrics Enable Flags 15] Warn for legacy Metrics property - #5956

Open
adinauer wants to merge 3 commits into
feat/warn-legacy-metrics-externalfrom
feat/warn-legacy-metrics-spring
Open

feat(spring): [Logs and Metrics Enable Flags 15] Warn for legacy Metrics property#5956
adinauer wants to merge 3 commits into
feat/warn-legacy-metrics-externalfrom
feat/warn-legacy-metrics-spring

Conversation

@adinauer

@adinauer adinauer commented Aug 13, 2026

Copy link
Copy Markdown
Member

PR Stack (Logs and Metrics Enable Flags)


📜 Description

Detects explicit sentry.metrics.enabled configuration through Spring's Environment in all three Spring Boot variants. Migration warnings are emitted after Sentry.init, when the diagnostic logger has been initialized.

Both true and false values emit tailored migration warnings. The obsolete property is not added back to SentryProperties and does not affect manual Metrics capture. Absent configuration emits no warning.

💡 Motivation and Context

After removal of the aggregate Metrics option, Spring's relaxed binder ignores the old property. Inspecting the complete Spring Environment preserves a useful migration diagnostic across property files, YAML, environment variables, command-line values, and other property sources.

💚 How did you test it?

  • ./gradlew :sentry-spring-boot:test :sentry-spring-boot-jakarta:test :sentry-spring-boot-4:test
  • ./gradlew spotlessApply apiDump
  • Added absent, explicit true, and explicit false tests to all three Spring Boot variants

📝 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 the first accepted Metrics item.

#skip-changelog

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

Inspect the Spring Environment before SDK initialization and emit tailored migration warnings for explicit sentry.metrics.enabled values without binding or applying the obsolete property.

Co-Authored-By: Claude <noreply@anthropic.com>
@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 532ecf2

@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

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 320.24 ms 363.04 ms 42.80 ms
Size 0 B 0 B 0 B

…y-metrics-spring

# Conflicts:
#	sentry-spring-boot-4/src/main/java/io/sentry/spring/boot4/SentryAutoConfiguration.java
#	sentry-spring-boot-jakarta/src/main/java/io/sentry/spring/boot/jakarta/SentryAutoConfiguration.java
#	sentry-spring-boot/src/main/java/io/sentry/spring/boot/SentryAutoConfiguration.java
@adinauer
adinauer requested a review from 0xadam-brown as a code owner August 13, 2026 13:41
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