Table of Contents
This simple demo project can be used as an example of setup Prometheus and Grafana to monitor a Spring-Boot application.
The Spring-Boot application is a scheduled task that periodically sends data to console log and micrometer monitoring. And the Prometheus service keeps scraping the data from the exposed actuator prometheus endpoint (http://localhost:8080/actuator/prometheus). Apart from these, the project also contains a demo Grafana dashboard that monitors the JVM information of the Spring-Boot application with JVM (Micrometer).
-
install and start Prometheus
wget https://s3-eu-west-1.amazonaws.com/deb.robustperception.io/41EFC99D.gpg | sudo apt-key add - sudo apt-get update -y sudo apt-get install prometheus prometheus-node-exporter prometheus-pushgateway prometheus-alertmanager -y sudo systemctl start prometheus sudo systemctl enable prometheus
-
install and start Grafana
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list sudo apt-get update sudo apt-get install grafana sudo systemctl daemon-reload sudo systemctl start grafana-server sudo systemctl status grafana-server
- Spring-Boot app - http://localhost:8080/
- Spring Boot Actuator Prometheus - http://localhost:8080/actuator/prometheus
- Prometheus - http://localhost:9090/
- Grafana - http://localhost:3000/ (default username/password: admin/admin)
Distributed under the MIT License. See LICENSE
for more information.
Project Link: https://github.com/cutePanda123/spring-boot-prometheus-demo