Example how to monitoring microservices with spring boot, Spring Actuator, Prometheus and Grafana.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
git clone https://github.com/gasperlf/spring-boot-monitoring.git
- Java 11
- Spring boot 2.2.4
- Docker
- Docker compose
- Prometheus
- Grafana
- YahooFinanceAPI Library (https://financequotes-api.com/)
- Postman
- Eclipse
- Intellij IDEA
##Running
- api-finance-service
- api-finance-service-reactive
- prometheus
- Grafana
-
mvn clean package
compile and create artifacts. -
docker-compose up -d
create docker image and run in a container.
Also you can use bash script start.sh
that contains both commands.
First in your browser http://localhost:3000
next Log in with user and password admin/admin
then create a datasource, select prometheus.
in this step you need to set URL from prometheus service, in this case http://[docker-container]:9090
(check docker compose name)
after that you can import a dashboard that I have included in Grafana folder, I prefer to use jvm-micrometer_rev9.json
check when you imported the dashboard choose the datasource created before.
and that is all.
0.0.1-snapshot
- Lewis Florez Renza