Exporting Spring Boot Actuator metrics over to Graphite
In the previous recipe we learned how to export the metrics we created using Codahale over to Graphite. In this recipe, we will see how we can expose some metrics Spring Boot offers. Unfortunately, at this moment, the MetricRegistry
does not expose all the metrics that Spring Boot offers. Only few of them are created using Codahale. If you take a look at the metrics that are available in /metrics
, most of them are JVM related. So in this recipe, we will find another way to expose the JVM metrics via Codahale.
Getting ready
In this recipe, we will be adding a Maven dependency and some Java code to the geolocation
project. So open up your STS IDE and navigate to the geolocation project. Make sure your Graphite instance is up and running. If not, start it using the docker-compose-graphite.yml
file we created.
How to do it...
In this recipe, we are going to expose some JVM metrics using Codahale. This will be exported to Graphite automatically...