Spring Application With Prometheus and Grafana
docker network create my-network
docker build --tag my-spring-app .
docker run --name my-spring-app -p "8080:8080" my-spring-app
# For Prometheus and Grafana
# docker-development-environment folder
docker-compose up -d
or
docker-compose -f <docker-filename> up -d
Endpoint: http://localhost:8080/
Prometheus: http://localhost:9090/
Main endpoint: http://localhost:8080/actuator
Grafana: http://localhost:3000/
username: grafana
password: grafana
- Add Visualization
- Add Prometheus Data Source
- Add Prometheus Server URL: http://host.docker.internal:9090
- Save and Test (Explore view link)
P.S.: You also can import "Spring Boot Statistics Dashboard.json" dashboard.