Class SentinelHealthIndicator

java.lang.Object
org.springframework.boot.actuate.health.AbstractHealthIndicator
com.alibaba.cloud.sentinel.endpoint.SentinelHealthIndicator
All Implemented Interfaces:
org.springframework.boot.actuate.health.HealthContributor, org.springframework.boot.actuate.health.HealthIndicator

public class SentinelHealthIndicator extends org.springframework.boot.actuate.health.AbstractHealthIndicator
A HealthIndicator for Sentinel, which checks the status of Sentinel Dashboard and DataSource.

Check the status of Sentinel Dashboard by sending a heartbeat message to it. If return true, it's OK. Check the status of Sentinel DataSource by calling loadConfig method of AbstractDataSource. If no Exception thrown, it's OK. If Dashboard and DataSource are both OK, the health status is UP.

Note: If Sentinel isn't enabled, the health status is up. If Sentinel Dashboard isn't configured, it's OK and mark the status of Dashboard with UNKNOWN. More informations are provided in details.

Author:
cdfive
  • Constructor Summary

    Constructors
    Constructor
    Description
    SentinelHealthIndicator(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory, SentinelProperties sentinelProperties)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doHealthCheck(org.springframework.boot.actuate.health.Health.Builder builder)
     

    Methods inherited from class org.springframework.boot.actuate.health.AbstractHealthIndicator

    health

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.boot.actuate.health.HealthIndicator

    getHealth
  • Constructor Details

    • SentinelHealthIndicator

      public SentinelHealthIndicator(org.springframework.beans.factory.support.DefaultListableBeanFactory beanFactory, SentinelProperties sentinelProperties)
  • Method Details

    • doHealthCheck

      protected void doHealthCheck(org.springframework.boot.actuate.health.Health.Builder builder) throws Exception
      Specified by:
      doHealthCheck in class org.springframework.boot.actuate.health.AbstractHealthIndicator
      Throws:
      Exception