Customization
The health endpoint consists of a health aggregator and any number of health indicators. To add a health indicator, simply create a bean class that implements HealthIndicator. It is recommended to also use either @Liveness or @Readiness qualifier. If no qualifier is used then the health incidator is part of /health and /health/readiness endpoints. A base class AbstractHealthIndicator has been provided for you to extend to make the process easier.
All of the health indicator beans will be collected together with the health aggregator. To provide your own implementation of the health aggregator, create a class that implements HealthAggregator and register it as a bean. To ensure your implementation is used instead of the default, add the @Replaces annotation to your class with the value being the default implementation.
The default health aggregator returns an overall status that is calculated based on the health statuses of the indicators. A health status consists of several pieces of information.
Name | The name of the status |
Description | The description of the status |
Operational | Whether the functionality the indicator represents is functional |
Severity | How severe the status is. A higher number is more severe |
The “worst” status will be returned as the overall status. A non operational status will be selected over an operational status. A higher severity will be selected over a lower severity.