Hi Robert, Thanks a lot for the info. I was also using MetricRegistry to register the gauge metrics. I thought there was a way to add the gauge metric using metricsService. After looking into the implementation of metricsService, it seems to be not trivial to add the gauge registration in the metricsService.
So, I will keep my implementation as it is to register gauge metrics using MetricRegistry. Thanks Allen On 5/25/20, 7:52 AM, "Robert Munteanu" <romb...@apache.org> wrote: Hi Allen, On Fri, 2020-05-22 at 20:52 +0000, Allen Liu wrote: > Hi all > > I have been using metricsService to add metric instrumentation for > counter, histogram, meter and timer. However, the metricsService > doesn’t seem to have a way to add gauge type instrumentation. > Does anyone know how to add gauge instrumentation using > metricsService? You should be able to reference a com.codahale.metrics.MetricRegistry service directly, and use the raw DropWizard APIs for gauges. Hope this helps, Robert