Implement observability directly with executable code and configurations.
Learning Path#
- Environment Setup - Configure Prometheus + Grafana + Loki + Tempo with Docker Compose
- Spring Boot Metrics - Configure Actuator + Micrometer
- Kafka Monitoring - Build Kafka cluster observability
- Full-Stack Observability - Integrate Metrics + Logs + Traces
Example Project Structure#
examples/
├── docker-compose.yml # Complete infrastructure
├── prometheus/
│ ├── prometheus.yml # Prometheus configuration
│ └── rules/ # Recording/Alerting Rules
├── grafana/
│ ├── provisioning/ # Datasources, dashboards
│ └── dashboards/ # JSON dashboards
└── spring-app/
└── application.yml # Spring Boot configurationTech Stack#
| Component | Tool | Role |
|---|---|---|
| Metrics Collection | Prometheus | Time-series metrics storage |
| Metrics Exposure | Micrometer | Spring Boot metrics |
| Log Collection | Loki + Promtail | Log storage/querying |
| Distributed Tracing | Tempo | Trace storage |
| Visualization | Grafana | Dashboard |
| Alerting | Alertmanager | Alert routing |
Prerequisites#
- Docker 24.0+
- Docker Compose 2.20+
- 4GB+ memory
- (Optional) Java 17+, Gradle 8+