https://github.com/dilermando-lima/springboot-grafana-prometheus-loki
Monitoring metrics and collecting logs with prometheus, grafana ana loki between rest apis
https://github.com/dilermando-lima/springboot-grafana-prometheus-loki
docker gradle grafana java21 loki prometheus spring spring-boot
Last synced: about 2 months ago
JSON representation
Monitoring metrics and collecting logs with prometheus, grafana ana loki between rest apis
- Host: GitHub
- URL: https://github.com/dilermando-lima/springboot-grafana-prometheus-loki
- Owner: dilermando-lima
- Created: 2025-02-25T13:38:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-25T13:58:03.000Z (over 1 year ago)
- Last Synced: 2025-02-25T14:45:43.311Z (over 1 year ago)
- Topics: docker, gradle, grafana, java21, loki, prometheus, spring, spring-boot
- Language: Java
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LOGS AND METRICS IN JAVA SPRING BOOT
## About this project
This project aims to show how to monitor metrics and logs between REST applications.
## Archtecture
Here's a diagram representing the hierarchy and dependencies among the projects in this repository:

## docker enviroment
Loki, prometheus and grafana configurtion are placed in ./docker/ folfer.
### Start containers
Run all container
```bash
# go to docker folder
cd ./docker
# run all containder services
docker compose up -d
```
### Configure prometheus in grafana
- Access grafana:
- Open your browser and go to http://localhost:3000
- log with default user `admin` and password `admin`
- Add Prometheus as a Data Source in Grafana:
- Go to Connections > Data Sources > Add data source.
- Select Prometheus and set the URL to http://prometheus:9090.
- Save it.
- Select a prometheus dashboard
- Go to dashboard
- New dashboard
- Import dashboard
- add dashboard template url http://grafana.com/grafana/dashboards/4701
### Configure loki in grafana
- Access grafana:
- Open your browser and go to http://localhost:3000
- log with default user `admin` and password `admin`
- Add Loki as a Data Source in Grafana:
- Go to Connections > Data Sources > Add data source.
- Select Loki and set the URL to http://loki:3100.
- Save it.