Observabilitymedium5-8 years

How does Spring Boot Actuator's /health endpoint combine multiple health indicators into one status, and how do liveness and readiness differ?

Actuator auto-detects HealthIndicator beans (database connectivity, disk space, a custom one you write) and a StatusAggregator rolls their individual statuses (UP, DOWN, OUT_OF_SERVICE, UNKNOWN, or a custom one) up into one overall status using an ordered precedence — DOWN generally wins over everything. Since Boot 2.3, health is also organised into groups: liveness (is the process itself broken and should be restarted?) and readiness (can it currently serve traffic?) are separate groups meant to back Kubernetes' liveness and readiness probes independently, because those two questions have different correct answers during, say, a slow downstream dependency.

The lesson behind it →
More on Observability