$ create database springbootĭoes that semantic look familiar for you? InfluxDB provides a very similar query language to SQL.
Then switch to the newly created database. As you can probably guess, it can be achieved using the command create database. After login, you should see the version of InfluxDB running on the target Docker container. Nothing simpler, just run the following command and you would be able to do it.
Once we started that container, you would probably want to login there and execute some commands. $ docker run -d -name influx -p 8086:8086 influxdb Here’s the simplest command that runs InfluxDB on your local machine and exposes HTTP API over 8086 port. The first step is typical for my examples – we will run a Docker container with InfluxDB. In the previous article I didn’t write much about this database and its configuration. So, our sample application needs to actively send data to the InfluxDB monitoring system, while with Prometheus it only has to expose endpoints that will be fetched for data periodically. The first of them is a push based system, while the second is a pull based system. There is one major difference between models of exporting metrics between InfluxDB and Prometheus.
For the current article, I have created the branch spring2 ( ), which show how to implement the same feature as before using version 2.0 of Spring Boot and Spring Boot Actuator.Īdditionally, I’m going to show you how to use Spring Boot Actuator to export the same metrics to another popular monitoring system – Prometheus. The sample Spring Boot application has been available for that article on GitHub repository sample-spring-graphite ( ) in the branch master. I described there how to export metrics generated by Spring Boot Actuator to InfluxDB using bean. You can see for yourself how much by reading one of my previous articles Custom metrics visualization with Grafana and InfluxDB. It is really a great simplification in comparison to the version used with Spring Boot 1.5.
Spring Boot Actuator also adds out-of-the-box support for exporting metrics to InfluxDB – an open-source time-series database designed to handle high volumes of timestamped data. It has been through major improvements, which aimed to simplify customization and include some new features like support for other web technologies, for example, the new reactive module – Spring WebFlux. Spring Boot Actuator is one of the most modified projects after the release of Spring Boot 2.