How richardl05/infrastructure-monitoring-using-prometheus-and-grafana works
This repository combines a Spring Boot board-game website with a documented Prometheus/Grafana monitoring setup. The main user workflow serves game listings and details, then lets authorized users add games and create or edit reviews; controllers delegate persistence to JDBC access. A separate REST API exposes board games. README-documented monitoring components collect host and website-probe metrics and present them in Grafana. The monitoring configuration and exporters are described in the README, not implemented in the sampled Java sources.
Main entry points: HomeController.java Page workflows · DatabaseAccess.java JDBC access · DatabaseServiceProjectApplication.java Spring Boot app · BoardGameController.java Board-game REST API
Components 21
Board-game Website
- Spring Boot app
src/main/java/com/javaproject/DatabaseServiceProjectApplication.java - Page workflows
src/main/java/com/javaproject/controllers/HomeController.java - Board-game REST API
src/main/java/com/javaproject/controllers/BoardGameController.java - Web pages
src/main/resources/templates - Form validation
src/main/resources/static/js/script.js
Domain and Persistence
- Board-game model
src/main/java/com/javaproject/beans/BoardGame.java - Review model
src/main/java/com/javaproject/beans/Review.java - API error model
src/main/java/com/javaproject/beans/ErrorMessage.java - JDBC access
src/main/java/com/javaproject/database/DatabaseAccess.java - Application database
src/main/resources/schema.sql
Identity and Access
- Security configuration
src/main/java/com/javaproject/security/SecurityConfig.java - Denied access handler
src/main/java/com/javaproject/security/LoggingAccessDeniedHandler.java - User and role records
Monitoring Stack
- Node Exporter
- Blackbox Exporter
- Scrape configuration
- Prometheus
- Grafana dashboards
Other components
- Website visitor
- Authorized user
- External websites
Connections 23
- Website visitor → Spring Boot app: requests pages
README.md - Authorized user → Spring Boot app: uses website
README.md - Spring Boot app → Page workflows: routes requests
- Page workflows → JDBC access: loads and saves
src/main/java/com/javaproject/controllers/HomeController.java - Page workflows → User and role records: creates users
src/main/java/com/javaproject/controllers/HomeController.java - Page workflows → Web pages: selects views
src/main/java/com/javaproject/controllers/HomeController.java - Website visitor → Board-game REST API: requests API
- Board-game REST API → JDBC access: loads and saves
src/main/java/com/javaproject/controllers/BoardGameController.java - Board-game REST API → API error model: returns errors
src/main/java/com/javaproject/controllers/BoardGameController.java - JDBC access → Application database: queries and updates
src/main/java/com/javaproject/database/DatabaseAccess.java - JDBC access → Board-game model: maps records
src/main/java/com/javaproject/database/DatabaseAccess.java - JDBC access → Review model: maps records
src/main/java/com/javaproject/database/DatabaseAccess.java - Board-game model → Review model: contains reviews
src/main/java/com/javaproject/beans/BoardGame.java - Security configuration → User and role records: authenticates users
src/main/java/com/javaproject/security/SecurityConfig.java - Security configuration → Denied access handler: delegates denial
src/main/java/com/javaproject/security/SecurityConfig.java - Denied access handler → Page workflows: redirects denied requests
- Website visitor → Node Exporter: exposes host metrics
README.md - Scrape configuration → Prometheus: configures scrapes
README.md - Prometheus → Node Exporter: scrapes metrics
README.md - Prometheus → Blackbox Exporter: requests probes
README.md - Blackbox Exporter → Spring Boot app: checks website
README.md - Blackbox Exporter → External websites: checks websites
README.md - Grafana dashboards → Prometheus: queries metrics
README.md