Skip to content

feat(micrometer): [Micrometer 4] Add Spring Boot integration - #6116

Draft
adinauer wants to merge 2 commits into
feat/micrometer-function-timerfrom
feat/micrometer-spring-boot
Draft

adinauer wants to merge 2 commits into
feat/micrometer-function-timerfrom
feat/micrometer-spring-boot

Conversation

@adinauer

@adinauer adinauer commented Sep 15, 2026

Copy link
Copy Markdown
Member

PR Stack (Micrometer)


📜 Description

Add opt-in Micrometer integration for Spring Boot 2, 3, and 4.

When sentry-micrometer and Micrometer are on the classpath, setting sentry.micrometer.enabled=true creates a SentryMeterRegistry bean that Spring adds to its composite registry. sentry.micrometer.poll-interval-millis controls passive polling and defaults to 60 seconds.

The artifact remains optional and is not added transitively by the existing starters. The Spring Boot samples add Actuator and verify that active HTTP metrics and passively polled process metrics reach real Sentry metric envelopes.

💡 Motivation and Context

Spring Boot applications commonly use Micrometer through Actuator. Thin conditional configuration lets those applications add Sentry as another metrics destination without replacing existing registries or enabling the integration merely because a class happens to be present.

Importing the configuration from the existing Sentry auto-configuration keeps lifecycle and initialization ordering aligned across all three supported Spring Boot generations.

💚 How did you test it?

./gradlew spotlessApply apiDump
./gradlew :sentry-micrometer:check :sentry-spring-boot:test :sentry-spring-boot-jakarta:test :sentry-spring-boot-4:test

The Spring Boot 2, 3, and 4 MetricsSystemTest suites also passed against the repository mock Sentry server on port 18080. They verify http.server.requests active metrics and passively polled process.uptime metrics in captured envelopes.

📝 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

Complete cross-SDK documentation and evaluate build-plugin installation separately.

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

Add opt-in Micrometer registry configuration for Spring Boot 2, 3, and 4 when the sentry-micrometer artifact is present.\n\nExpose polling configuration, register the Sentry registry with Spring's composite registry, and verify active and passive metric delivery through sample system tests.\n\nCo-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 15, 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 64381f2

@sentry

sentry Bot commented Sep 15, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

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