DropWizard Metrics 101
Photo courtesy of nathanmac87.
My most recent project at work has been to utilize DropWizard metrics to gather information about an application I built and send that data to Graphite to display in a realtime dashboard. As I normally do, I reviewed the documentation for Dropwizard Metrics, but as usual, there was a lot to be desired. Their example did not go into the nitty gritty of how to connect everything together. The internet was also silent on how to actually use DropWizard metrics.
So here is my tutorial on how I was able to get DropWizard metrics up and running in my application:
1. Maven Application? Update pom.xml
If you’ve got a Maven application, you’ll need to add metrics-core as a dependency. If you’re using some sort of special reporter like Graphite, you may need to add an additional dependency. This was what I had to add to my pom:
To read the rest of this article, click here! You'll want to anyway. There's code!