This project provides a plug-and-play observability stack for a quarkus application using Prometheus and Grafana, fully containerized with Docker Compose. All Grafana data sources and dashboards are pre-provisioned and automatically loaded at startup.
- Prometheus for metrics collection and storage.
- Grafana for visualization, with pre-configured data sources and dashboards.
- Simple, fast deployment via Docker Compose.
├── docker-compose
│ ├── docker-compose.yml
│ ├── grafana
│ │ ├── dashboard.yaml
│ │ ├── dashboards
│ │ │ └── dashboard.json
│ │ └── datasources
│ │ └── datasource.yaml
│ └── prometheus.yml
└── src
└── main
├── docker
│ └── Dockerfile.jvm
├── java
│ └── GreetingController.java
└── resources
└── application.properties
- docker-compose/docker-compose.yml: Orchestrates Quarkus App, Prometheus and Grafana containers.
- docker-compose/prometheus.yml: Prometheus scrape configuration.
- docker-compose/grafana/dashboards/: Contains Grafana dashboard JSON files for automatic import.
- docker-compose/grafana/datasources/: Contains Grafana data source YAML files.
- src/: Quarkus application folder.
-
Clone or copy this repository and navigate to the project directory
-
Start the observability stack:
./gradlew build
cd docker-compose
docker compose up -d
- Access the services:
Quarkus App Swagger UI: http://localhost:8080/q/swagger-ui/
Grafana: http://localhost:3000 (default login: admin
/ admin
)
Prometheus: http://localhost:9090
- Make a request
Go to http://localhost:8080/q/swagger-ui/ and make a request for greeting resource.
- View dashboards in Grafana:
Pre-provisioned dashboards will appear under the "Dashboards" section in Grafana.
- Add dashboards: Place your dashboard JSON files in
grafana/provisioning/dashboards/
or add another dashboard on Grafana UI. - Add or edit data sources: Modify
grafana/provisioning/datasources/datasource.yml
or use Grafana UI. - Change Prometheus targets: Edit
prometheus/prometheus.yml
as needed.
- Change the default Grafana admin password after first login for security.
- Data is persisted in Docker volumes (unless you modify the Compose file).
Enjoy your plug-and-play observability stack!