org.springframework.boot.actuate.health

Class Health



  • public final class Health
    extends Object
    Carries information about the health of a component or subsystem.

    Health contains a Status to express the state of a component or subsystem and some additional details to carry some contextual information.

    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 new Health.Builder().up().withDetail("version", "1.1.2").build();
     }
     catch (Exception ex) {
            return new Health.Builder().down(ex).build();
     }
     
    Since:
    1.1.0
    Author:
    Christian Dupuis, Phillip Webb