A health indicator in Spring Boot is a bean that implements HealthIndicator and reports the status of one component, such as a database, cache or external API. Spring Boot Actuator collects all indicators and combines them into the overall result served at /actuator/health, where the worst individual status wins.
Actuator ships indicators for common infrastructure, and you add your own for anything specific to your system. The examples use Spring Boot 3.x.
Every HealthIndicator returns a Health object holding a Status and optional details. A HealthContributorRegistry gathers them, and the HealthEndpoint aggregates them through a StatusAggregator. The default aggregation order is DOWN, OUT_OF_SERVICE, UP, UNKNOWN, so one failing component makes the whole application DOWN.
Add the dependency first:
Spring Boot auto-configures an indicator when the matching technology is present:
| Indicator name | Checks |
|---|---|
db | Connection to the DataSource |
diskSpace | Free disk space against a threshold |
ping | A simple always-UP check |
redis | Redis connectivity |
mongo | MongoDB availability |
rabbit | RabbitMQ connection |
mail | SMTP server connectivity |
Disable one with management.health.<name>.enabled=false, for example management.health.redis.enabled=false. Tune the disk threshold with management.health.diskspace.threshold.
Create a Spring bean that implements HealthIndicator. The component name in the JSON is the bean name without the HealthIndicator suffix.
The response then contains:
Always set short timeouts. Health endpoints are called frequently, and a hanging check blocks the probe.
AbstractHealthIndicator wraps your code in a try and catch for you: any exception becomes DOWN with the error attached.
In a WebFlux application implement ReactiveHealthIndicator and return a Mono<Health> so the check does not block an event-loop thread.
A custom status such as DEGRADED needs an ordering and, usually, an HTTP mapping:
Without a mapping, unknown statuses return HTTP 200. DOWN and OUT_OF_SERVICE map to 503 by default.
Details are hidden unless you set management.endpoint.health.show-details to when-authorized or always. You can also fetch a single component with /actuator/health/inventoryApi, and group indicators for Kubernetes probes:
The health check is the endpoint (/actuator/health). A health indicator is one bean that contributes the status of a single component to that endpoint.
Return a custom status such as DEGRADED with a mapped HTTP code, or keep the non-critical indicator out of the readiness and liveness groups.
Spring Boot calls indicators when the endpoint is requested, so cache expensive results yourself, or use management.endpoint.health.cache.time-to-live.
Yes. Use ReactiveHealthIndicator; Actuator adapts blocking indicators on a bounded elastic scheduler as well.
A HealthIndicator reports the status of one component, and Actuator merges all of them into the application health. Use the built-in indicators, add custom beans for your own dependencies with short timeouts, define custom statuses where needed, and group indicators for readiness checks.