Class HealthEndpoint
java.lang.Object
io.micronaut.management.endpoint.health.HealthEndpoint
Exposes an Endpoint to provide information about the health of the application.
- Since:
- 1.0
- Author:
- James Kleeh
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration related to handling of theHealthStatus. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHealthEndpoint(HealthAggregator<HealthResult> healthAggregator, HealthIndicator[] healthIndicators, HealthIndicator[] livenessHealthIndicators) -
Method Summary
Modifier and TypeMethodDescriptionReturn all health indicators.getHealth(@Nullable Principal principal, HealthCheckType selector) Return health indicators based on the selector.protected final HealthIndicator[]getReadinessHealthIndicators(HealthIndicator[] allHealthIndicators, HealthIndicator[] livenessHealthIndicators) booleanWhether theServiceReadyHealthIndicatoris enabled.protected HealthLevelOfDetaillevelOfDetail(@Nullable Principal principal) Returns the level of detail that should be returned by the endpoint.voidsetDetailsVisible(DetailsVisibility detailsVisible) Sets the visibility policy for health information.voidsetServiceReadyIndicatorEnabled(boolean serviceReadyIndicatorEnabled) Set whether theServiceReadyHealthIndicatoris enabled.voidsetStatusConfiguration(HealthEndpoint.StatusConfiguration statusConfiguration) Sets the status configuration.
-
Field Details
-
DEFAULT_SENSITIVE
public static final boolean DEFAULT_SENSITIVEIf the endpoint is sensitive if no configuration is provided.- See Also:
-
NAME
Constant for health.- See Also:
-
PREFIX
Prefix for health endpoint.- See Also:
-
-
Constructor Details
-
HealthEndpoint
public HealthEndpoint(HealthAggregator<HealthResult> healthAggregator, HealthIndicator[] healthIndicators, @Liveness HealthIndicator[] livenessHealthIndicators) - Parameters:
healthAggregator- TheHealthAggregatorhealthIndicators- TheHealthIndicatorlivenessHealthIndicators- TheHealthIndicatorqualified byLiveness
-
-
Method Details
-
getReadinessHealthIndicators
protected final HealthIndicator[] getReadinessHealthIndicators(HealthIndicator[] allHealthIndicators, HealthIndicator[] livenessHealthIndicators) -
getHealth
@Read @SingleResult public Publisher<HealthResult> getHealth(@Nullable @Nullable Principal principal) Return all health indicators.- Parameters:
principal- Authenticated user- Returns:
- The health information as a
Mono
-
getHealth
@Read @SingleResult public Publisher<HealthResult> getHealth(@Nullable @Nullable Principal principal, @Selector HealthCheckType selector) Return health indicators based on the selector.- Parameters:
principal- Authenticated userselector- HealthEndpointSelector- Returns:
- The health information as a
Mono
-
isServiceReadyIndicatorEnabled
public boolean isServiceReadyIndicatorEnabled()Whether theServiceReadyHealthIndicatoris enabled. Defaults totrue.- Returns:
- True if it is enabled.
-
setServiceReadyIndicatorEnabled
public void setServiceReadyIndicatorEnabled(boolean serviceReadyIndicatorEnabled) Set whether theServiceReadyHealthIndicatoris enabled. Defaults totrue.- Parameters:
serviceReadyIndicatorEnabled- True if the service ready indicator should be enabled.
-
getDetailsVisible
- Returns:
- The visibility policy for health information.
-
setDetailsVisible
Sets the visibility policy for health information.- Parameters:
detailsVisible- TheDetailsVisibility
-
getStatusConfiguration
- Returns:
- The status configuration
-
setStatusConfiguration
Sets the status configuration.- Parameters:
statusConfiguration- The status configuration
-
levelOfDetail
Returns the level of detail that should be returned by the endpoint.- Parameters:
principal- Authenticated user- Returns:
- The
HealthLevelOfDetail
-