I was upgrading spring boot to 2 in one of the project.
I am facing issue with @Autowire metricRegistry:MetricRegistry
I had read upgrade guide where it is mentioned that Metrics are replaced by Micrometer's MeterRegistry.
Since, Dropwizard MetricRegistry is havely used in current project, it is difficult to replace it.
Is there any possibility to use Dropwizard MetricRegistry with spring boot 2 and @Autowire metricRegistry:MetricRegistry get work?
Fyi: Spring Boot 2 reached its end of OSS support life a while ago, you should upgrade to the latest 3.x: https://spring.io/projects/spring-boot#support
You should take a look at
DropwizardMeterRegistry, you can use it as:Then you can inject
MeterRegistry(Micrometer's API) in new code and keep usingMetricsRegistry(Dropwizard's API) in old code.