Dropwizard to Micrometer migration (MetricRegistry & ConsoleReporter)

Viewed 20

I had an old project I am trying to migrate to micrometer that I previously set with Dropwizard metrics which essentially followed this getting started tutorial https://metrics.dropwizard.io/4.2.0/getting-started.html

Naturally Everything else in my code has moved perfectly, all my other classes were similar, but it seemed two classes, MetricRegistry and ConsoleReporter are not part of the Micrometer family... And the code is identical to that tutorial link I just shared.

Any advice or links to make the migration to micrometer for these two classes? I'd like to change as little as possible in the process of course. Just two classes and the MetricRegistry meter function of Dropwizard https://javadoc.io/doc/io.dropwizard.metrics/metrics-core/4.1.0-rc2/com/codahale/metrics/MetricRegistry.html#meter-java.lang.String-com.codahale.metrics.MetricRegistry.MetricSupplier- as you can see in use for the tutorial too

1 Answers

I’m not 100% sure what you are doing but Micrometer has a MeterRegistry but you might be already aware of that. I don’t recommend writing metrics to logs but you can take a look at LoggingMeterRegistry if you really want to.

Related