/actuator/prometheus missing in @SpringbootTest

Update: @Thierry mentioned @AutoConfigureMetrics is deprecated and one needs to use the @AutoConfigureObservability annotation instead. See his post! Original post: I faced the same issue. After some tracing through spring-context ConditionEvaluator, I found that the newly introduced @ConditionalOnEnabledMetricsExport(“prometheus”) condition on PrometheusMetricsExportAutoConfiguration prevented the endpoint from loading. This is intended behavior due to https://github.com/spring-projects/spring-boot/pull/21658 and impacts … Read more