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
Modifier and TypeClassDescriptionstatic class
Configuration related to handling of theHealthStatus
. -
Field Summary
-
Constructor Summary
ConstructorDescriptionHealthEndpoint
(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) boolean
Whether theServiceReadyHealthIndicator
is enabled.protected HealthLevelOfDetail
levelOfDetail
(@Nullable Principal principal) Returns the level of detail that should be returned by the endpoint.void
setDetailsVisible
(DetailsVisibility detailsVisible) Sets the visibility policy for health information.void
setServiceReadyIndicatorEnabled
(boolean serviceReadyIndicatorEnabled) Set whether theServiceReadyHealthIndicator
is enabled.void
setStatusConfiguration
(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
- TheHealthAggregator
healthIndicators
- TheHealthIndicator
livenessHealthIndicators
- TheHealthIndicator
qualified 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 theServiceReadyHealthIndicator
is enabled. Defaults totrue
.- Returns:
- True if it is enabled.
-
setServiceReadyIndicatorEnabled
public void setServiceReadyIndicatorEnabled(boolean serviceReadyIndicatorEnabled) Set whether theServiceReadyHealthIndicator
is 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
-