Creating custom metrics using Dropwizard
So far in this chapter, we've learned how to use the Spring Boot Actuator metrics. But what if your application is not Spring Boot and you still want to create metrics of your own? That is what this recipe will help you with. Not every microservice needs to be Spring Boot based. There are some microservices that could be written with other microservice frameworks. In those cases, if you would like to create your own metrics, you could use Dropwizard's Codahale library. Codahale is one of the most popular metrics libraries available for Java-based applications. In fact, Spring Boot internally uses Codahale to create some of its metrics. In this recipe, we will be using the Codahale library to create a metric for the geolocation application.
Getting ready
If you are wondering what the association between Dropwizard and Codahale is, the answer is that Codahale falls under the Dropwizard umbrella. Dropwizard is an ecosystem of libraries that can be used...