dropwizard / metrics

:chart_with_upwards_trend: Capturing JVM- and application-level metrics. So you know what's going on.
https://metrics.dropwizard.io
Apache License 2.0
7.84k stars 1.81k forks source link

MetricRegistryListener should be invoked before adding meter to the registry #1456

Closed asarkar closed 5 years ago

asarkar commented 5 years ago

I'm trying to capture Cassandra client-side query latency metrics using Micrometer. Cassandra Java driver exposes some metrics through Dropwizard, but there's no way to bridge Dropwizard -> Micrometer for general meters like timers and histograms; Dropwizard MetricRegistryListener methods are invoked after a meter has been added to the registry, thus eliminating any chance of interception.

If the methods in a MetricRegistryListener are invoked before a meter has been added to the registry, clients may choose to proxy/wrap desired meters, thus making it possible to easily collect metrics using the library of their choice.

asarkar commented 5 years ago

Moved to https://github.com/dropwizard/metrics/issues/1455