Module 8. Production-Ready Spring Boot: Actuator, Metrics, Observability
Module goal
Learn to prepare a Spring Boot service for production: monitoring, health checks, metrics, and operational basics.
What we cover
- Why Actuator is required in real systems.
- Which endpoints are essential for production.
- How to build a minimal observability strategy.
Step 1. Add Actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
Step 2. Core endpoints
/actuator/health- service health state./actuator/info- service metadata./actuator/metrics- application metrics./actuator/prometheus- metrics scrape endpoint.
Step 3. Configuration
management.endpoints.web.exposure.include=health,info,metrics,prometheus
management.endpoint.health.show-details=when_authorized
Step 4. Minimal production pipeline
- Service exposes
/actuator/health. - Orchestrator/LB uses health checks.
- Prometheus scrapes
/actuator/prometheus. - Grafana visualizes latency, errors, throughput.
Step 5. First metrics to track
- Response time (p95/p99).
- Error rate (4xx/5xx).
- Database load.
- Memory and garbage collection.
Common mistakes
- Exposing all actuator endpoints publicly.
- No alerting for critical metrics.
- Treating logs, metrics, and traces as separate disconnected systems.
Mini homework
- Add Actuator to the project.
- Restrict exposed endpoints.
- Run local Prometheus + Grafana and build 2-3 dashboards.
Final course checklist
- I understand Spring Framework architecture.
- I can use DI and auto-configuration intentionally.
- I can design REST APIs with validation and error handling.
- I can use JPA while watching performance.
- I can make services observable and production-ready.