Adding additional metrics to Dropwizard

johncowie picture johncowie · Mar 26, 2013 · Viewed 14.9k times · Source

How do I go about adding custom metrics to the default stuff that Dropwizard provides on the admin port (8081)? I can't find anything in the documentation apart from adding health checks. I'd quite like to incorporate some stats retrieved from MongoDB, and would rather keep it with the admin resources on 8081 than create a custom metrics page on port 8080.

Answer

Michael Fairley picture Michael Fairley · Mar 26, 2013

Dropwizard's using the Metrics library for all of its metrics. Metric's getting started section has everything you need to start adding your own.