Interface HealthIndicatorService

All Known Implementing Classes:
DiskHealthIndicatorService, RepositoryIntegrityHealthIndicatorService, ShardsAvailabilityHealthIndicatorService, ShardsCapacityHealthIndicatorService, StableMasterHealthIndicatorService

public interface HealthIndicatorService
This is a service interface used to calculate health indicator from the different modules or plugins. NOTE: if you are adding the name of an indicator or the id of a diagnosis you need to update the configuration of the health-api-indexer in the telemetry repository so the new/changed fields will be indexed properly.
  • Field Details

    • MAX_AFFECTED_RESOURCES_COUNT

      static final int MAX_AFFECTED_RESOURCES_COUNT
      See Also:
  • Method Details

    • name

      String name()
    • calculate

      default HealthIndicatorResult calculate(boolean verbose, HealthInfo healthInfo)
    • calculate

      HealthIndicatorResult calculate(boolean verbose, int maxAffectedResourcesCount, HealthInfo healthInfo)
    • createIndicator

      default HealthIndicatorResult createIndicator(HealthStatus status, String symptom, HealthIndicatorDetails details, Collection<HealthIndicatorImpact> impacts, List<Diagnosis> diagnosisList)
      This method creates a HealthIndicatorResult with the given information. Note that it sorts the impacts by severity (the lower the number the higher the severity), and only keeps the 3 highest-severity impacts.
      Parameters:
      status - The status of the result
      symptom - The symptom used in the result
      details - The details used in the result
      impacts - A collection of impacts. Only the 3 highest severity impacts are used in the result
      Returns:
      A HealthIndicatorResult built from the given information
    • isPreflight

      default boolean isPreflight()
      A preflight indicator is an indicator that is run first and represents a serious cascading health problem. For example, the `stable_master` health indicator is a preflight indicator. When it is red it means that the node has witnessed too many master nodes which could mean there are missing nodes, or a discovery problem, or that the node itself has problems joining the elected master. For these reasons, it likely that the cluster state is not up-to-date enough for us to make health decisions off of it.
      Returns:
      true if this is a preflight indicator, false otherwise.