Class HealthEndpoint
- java.lang.Object
-
- io.micronaut.management.endpoint.health.HealthEndpoint
-
@Endpoint(value="health", defaultSensitive=false) public class HealthEndpoint extends java.lang.Object
Exposes an
Endpointto provide information about the health of the application.- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHealthEndpoint.StatusConfigurationConfiguration related to handling of theHealthStatus.
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_SENSITIVEIf the endpoint is sensitive if no configuration is provided.static java.lang.StringNAMEConstant for health.static java.lang.StringPREFIXPrefix for health endpoint.
-
Constructor Summary
Constructors Constructor Description HealthEndpoint(HealthAggregator<HealthResult> healthAggregator, HealthIndicator[] healthIndicators, HealthIndicator[] livenessHealthIndicators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DetailsVisibilitygetDetailsVisible()org.reactivestreams.Publisher<HealthResult>getHealth(java.security.Principal principal)Return all health indicators.org.reactivestreams.Publisher<HealthResult>getHealth(java.security.Principal principal, HealthCheckType selector)Return health indicators based on the selector.protected HealthIndicator[]getReadinessHealthIndicators(HealthIndicator[] allHealthIndicators, HealthIndicator[] livenessHealthIndicators)HealthEndpoint.StatusConfigurationgetStatusConfiguration()protected HealthLevelOfDetaillevelOfDetail(java.security.Principal principal)Returns the level of detail that should be returned by the endpoint.voidsetDetailsVisible(DetailsVisibility detailsVisible)Sets the visibility policy for health information.voidsetStatusConfiguration(HealthEndpoint.StatusConfiguration statusConfiguration)Sets the status configuration.
-
-
-
Field Detail
-
DEFAULT_SENSITIVE
public static final boolean DEFAULT_SENSITIVE
If the endpoint is sensitive if no configuration is provided.- See Also:
- Constant Field Values
-
NAME
public static final java.lang.String NAME
Constant for health.- See Also:
- Constant Field Values
-
PREFIX
public static final java.lang.String PREFIX
Prefix for health endpoint.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HealthEndpoint
public HealthEndpoint(HealthAggregator<HealthResult> healthAggregator, HealthIndicator[] healthIndicators, @Liveness HealthIndicator[] livenessHealthIndicators)
- Parameters:
healthAggregator- TheHealthAggregatorhealthIndicators- TheHealthIndicatorlivenessHealthIndicators- TheHealthIndicatorqualified byLiveness
-
-
Method Detail
-
getReadinessHealthIndicators
protected final HealthIndicator[] getReadinessHealthIndicators(HealthIndicator[] allHealthIndicators, HealthIndicator[] livenessHealthIndicators)
-
getHealth
@Read @SingleResult public org.reactivestreams.Publisher<HealthResult> getHealth(@Nullable java.security.Principal principal)
Return all health indicators.- Parameters:
principal- Authenticated user- Returns:
- The health information as a
Mono
-
getHealth
@Read @SingleResult public org.reactivestreams.Publisher<HealthResult> getHealth(@Nullable java.security.Principal principal, @Selector HealthCheckType selector)
Return health indicators based on the selector.- Parameters:
principal- Authenticated userselector- HealthEndpointSelector- Returns:
- The health information as a
Mono
-
getDetailsVisible
public DetailsVisibility getDetailsVisible()
- Returns:
- The visibility policy for health information.
-
setDetailsVisible
public void setDetailsVisible(DetailsVisibility detailsVisible)
Sets the visibility policy for health information.- Parameters:
detailsVisible- TheDetailsVisibility
-
getStatusConfiguration
public HealthEndpoint.StatusConfiguration getStatusConfiguration()
- Returns:
- The status configuration
-
setStatusConfiguration
@Inject public void setStatusConfiguration(HealthEndpoint.StatusConfiguration statusConfiguration)
Sets the status configuration.- Parameters:
statusConfiguration- The status configuration
-
levelOfDetail
protected HealthLevelOfDetail levelOfDetail(@Nullable java.security.Principal principal)
Returns the level of detail that should be returned by the endpoint.- Parameters:
principal- Authenticated user- Returns:
- The
HealthLevelOfDetail
-
-