Skip to content

Fix Spring Boot 4 Micrometer auto-configuration and add actuator metrics smoke coverage#4672

Open
xiang17 wants to merge 6 commits intomicrosoft:mainfrom
xiang17:xiang17/SpringBoot4-ActuatorMetrics
Open

Fix Spring Boot 4 Micrometer auto-configuration and add actuator metrics smoke coverage#4672
xiang17 wants to merge 6 commits intomicrosoft:mainfrom
xiang17:xiang17/SpringBoot4-ActuatorMetrics

Conversation

@xiang17
Copy link
Copy Markdown
Member

@xiang17 xiang17 commented Apr 4, 2026

Fix #4577.

Spring Boot 4 moved Micrometer metrics auto-configuration classes from
org.springframework.boot.actuate.autoconfigure.metrics.* to
org.springframework.boot.micrometer.metrics.autoconfigure.*.

Our Micrometer instrumentation was still keyed only to the Spring Boot 3 class
names, which meant the Azure Monitor meter registry auto-configuration was not
being inserted for Spring Boot 4 applications. As a result, custom Micrometer
metrics such as demo.requests.total could be present locally but never reach
Application Insights.

This change updates the Micrometer instrumentation to support both Spring Boot 3
and Spring Boot 4 auto-configuration class names, and adds smoke coverage for
the Spring Boot 4 path.

Suggested testing

  • ./gradlew :smoke-tests:apps:ActuatorMetricsSpringBoot4:smokeTest --tests '*ActuatorMetricsSpringBoot4Test$Java21Test'
  • ./gradlew :smoke-tests:apps:Micrometer:smokeTest --tests "*MicrometerTest*"

xiang17 added 6 commits April 3, 2026 19:03
… Boot 4 logging so the test can reach the intended Micrometer failure path. 2. making one small adjustment so the app boots with a local SimpleMeterRegistry and the test fails exactly on the missing AI metric behavior
…ame to org.springframework.boot.micrometer.metrics.autoconfigure.* (different module/package)
@xiang17 xiang17 marked this pull request as ready for review April 5, 2026 00:35
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.

Micrometer metrics not pushed to Application Insights after upgrade to Spring Boot 4.0.0

1 participant