Fix Spring Boot 4 Micrometer auto-configuration and add actuator metrics smoke coverage#4672
Open
xiang17 wants to merge 6 commits intomicrosoft:mainfrom
Open
Fix Spring Boot 4 Micrometer auto-configuration and add actuator metrics smoke coverage#4672xiang17 wants to merge 6 commits intomicrosoft:mainfrom
xiang17 wants to merge 6 commits intomicrosoft:mainfrom
Conversation
…umentation for Spring Boot 4
… 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #4577.
Spring Boot 4 moved Micrometer metrics auto-configuration classes from
org.springframework.boot.actuate.autoconfigure.metrics.*toorg.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.totalcould be present locally but never reachApplication 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*"