Spring Boot & Microservices (50 Qs)•Part 1: Spring Core, Auto-Configuration & Architecture (1 - 10)
What is Spring Boot Actuator, and how do you configure it in production?
senior LevelCode ExampleSystem Design
In Simple Words:
Spring Boot Actuator provides production-ready monitoring endpoints (/actuator/health, /actuator/metrics, /actuator/prometheus).
- In production, never expose all endpoints publicly.
- Expose only
healthandprometheusmetrics to internal monitoring tools. - Protect sensitive endpoints with Spring Security.
yaml
# application.yml
management:
endpoints:
web:
exposure:
include: "health,info,prometheus"
endpoint:
health:
show-details: when-authorized
probes:
enabled: true # Kubernetes liveness and readiness probes