hystrix-dashboard用來監控hystrix熔斷器的狀態web
經過Hystrix提供的hystrix.stream實現,把對應的URL地址放入Hystrix Dashboard中查看狀態 ui
侷限:hystrix-dashboard只能監控一個服務3d
hystrix-dashboard配合actuator使用blog
須打開全部端口 的監控ip
management:
endpoints:
web:
exposure:
include: '*' #打開全部端口 的監控ci
localhost:8080/actuator/hystrix.streamrequests
爲了彌補hystrix-dashboard只能監控一個服務的侷限,須結合Turbine來使用it
Turbine就是聚合系統的全部集羣的健康狀態,就是把每一個服務的/hystrix.stream,所有聚合在/turbine.stream中,經過Hystrix Dashboard中可視化查看集羣
------------------------------------------------------------------------------------------------------------------------------監控
面板參數:
斷路器
(1)hystrix.command.default.circuitBreaker.requestVolumeThreshold(當在配置時間窗口內達到此數量的失敗後,進行短路。默認20個)
For example, if the value is 20, then if only 19 requests are received in the rolling window (say a window of 10 seconds) the circuit will not trip open even if all 19 failed.
簡言之,10s內請求失敗數量達到20個,斷路器開。
(2)hystrix.command.default.circuitBreaker.sleepWindowInMilliseconds(短路多久之後開始嘗試是否恢復,默認5s)
(3)hystrix.command.default.circuitBreaker.errorThresholdPercentage(出錯百分比閾值,當達到此閾值後,開始短路。默認50%)