Spring Boot 2.7.0
After upgrading my app to spring boot 2.7.0 the http_server_requests_seconds_count prometheus metric is missing.
Found that the bean in charge org.springframework.boot.actuate.autoconfigure.metrics.web.servlet.WebMvcMetricsAutoConfiguration.webMvcMetricsFilter is not instantiated any longer since a @ConditionalOnMissingBean was added.
The debug of the bean initialization:
...
WebMvcMetricsAutoConfiguration#webMvcMetricsFilter:
Did not match:
- @ConditionalOnMissingBean (types: org.springframework.boot.web.servlet.FilterRegistrationBean; SearchStrategy: all) found beans of type 'org.springframework.boot.web.servlet.FilterRegistrationBean' logbackAccessSecurityServletFilter, traceIdInResponseFilterRegistration (OnBeanCondition)
...
shows that there are already FilterRegistrationBeans present which is prohibiting the instantiation of org.springframework.boot.actuate.autoconfigure.metrics.web.servlet.WebMvcMetricsAutoConfiguration.webMvcMetricsFilter?
Example: test-http-metrics.zip
Comment From: wilkinsona
Thanks for the report and sample. This is a duplicate of https://github.com/spring-projects/spring-boot/issues/31150.