Class HealthEndpoint

java.lang.Object
io.micronaut.management.endpoint.health.HealthEndpoint

@Endpoint(value="health", defaultSensitive=false) public class HealthEndpoint extends Object

Exposes an Endpoint to provide information about the health of the application.

Since:
1.0
  • Field Details

  • Constructor Details

  • Method Details

    • getReadinessHealthIndicators

      protected final HealthIndicator[] getReadinessHealthIndicators(HealthIndicator[] allHealthIndicators, HealthIndicator[] livenessHealthIndicators)
    • getHealth

      @Read @SingleResult public org.reactivestreams.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 org.reactivestreams.Publisher<HealthResult> getHealth(@Nullable @Nullable Principal principal, @Selector HealthCheckType selector)
      Return health indicators based on the selector.
      Parameters:
      principal - Authenticated user
      selector - HealthEndpointSelector
      Returns:
      The health information as a Mono
    • isServiceReadyIndicatorEnabled

      public boolean isServiceReadyIndicatorEnabled()
      Whether the ServiceReadyHealthIndicator is enabled. Defaults to true.
      Returns:
      True if it is enabled.
    • setServiceReadyIndicatorEnabled

      public void setServiceReadyIndicatorEnabled(boolean serviceReadyIndicatorEnabled)
      Set whether the ServiceReadyHealthIndicator is enabled. Defaults to true.
      Parameters:
      serviceReadyIndicatorEnabled - True if the service ready indicator should be enabled.
    • 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 - The DetailsVisibility
    • 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 @Nullable Principal principal)
      Returns the level of detail that should be returned by the endpoint.
      Parameters:
      principal - Authenticated user
      Returns:
      The HealthLevelOfDetail