Class Health

java.lang.Object
org.springframework.boot.health.contributor.Health

public final class Health extends Object
The health of a component or subsystem in including its Status as well as any additional contextual details. Subclasses should expect to be serialized and presented to the user, typically as JSON.

Health instances can be created by using Health.Builder's fluent API. Typical usage in a HealthIndicator would be:

try {
        // do some test to determine state of component
        return Health.up().withDetail("version", "1.1.2").build();
}
catch (Exception ex) {
        return Health.down(ex).build();
}
Since:
4.0.0
Author:
Christian Dupuis, Phillip Webb, Michael Pratt