I really like the capabilities of Grafana for graphing metrics over time and showing a nice dashboard. I'd like to use it to track CPU, Mem, etc throughout my deployment environment. I'd also like to use it to track some numbers from my Java programs. How can I connect Java to Grafana?
Grafana supports three different database solutions (graphite, influxdb, OpenTSDB). I am not using any of these at the moment. But influxdb looks easy to setup. I'm really just looking for something simple and future-proof. It will only monitor a few servers for now, but it may grow in time. Is there an easy way to push a single Java integer with a label and timestamp into Grafana. I'm thinking there must be something like log4j for metrics. But I also need to decide which database to use, but hopefully that would be abstracted out of the interface. Any advice?
Grafana is 'just' a tool to display time series. Which means you will need an additional time series database between your java apllication and grafana.
You can find the current list of supported databases on their offical website: Datasources
As you mentioned influxdb, you might want to have a look at this influxdb-java project
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With