Exposing Spring Boot metrics to influxDB for grafana visualization

citizenBane picture citizenBane · Sep 18, 2015 · Viewed 8.8k times · Source

I have a Spring Boot application running on Cloud Foundry that exposes metrics and health info via the /metrics & /health endpoints respectively. I'd like to post these metrics as a continuous stream to an influxDB user provided service for visualization on a grafana dashboard. I am looking for any resources that explain how the dataflow would work and would appreciate any suggestions.

Thanks.

Answer

geoand picture geoand · Sep 18, 2015

As far as I know there is no ready made solution. However what you can do is implement a custom Exporter for InfluxDB.

The details of how to do this in Spring Boot can be found here. In essence what you need to implement is an exporter that converts the Spring Boot metrics data to InfluxDB's line protocol

Another possible solution would be to get the Spring Boot metrics into Dropwizard metrics and then use this external library for reporting the Dropwizard metrics into InfluxDB (or use the master branch of dropwizard metrics which already an InfluxDB backend).

Finally, if you want to forgo InfluxDB and instead save the data into Graphite's storage (Whisper database), you should check out this or this. Once the data is in Graphite, Grafana can easily visualize it as is shown here