Health Indicator
健康指标
https://cloud.spring.io/spring-cloud-static/Brixton.SR7/
就是我这个movie应用,访问movie应用的health,路径它会得到这种东西
The state of the connected circuit breakers are also exposed in the /health endpoint of
the calling application.
{
"hystrix": {
"openCircuitBreakers": [
"StoreIntegration::getStoresByLocationLink"
],
"status": "CIRCUIT_OPEN"
},
"status": "UP"
}
10.40.8.152:8761
localhost:8010/health
{"description":"Spring Cloud Eureka Discovery Client","status":"UP"}
localhost:8010/movie/1
请求到用户微服务的API
Hystrix Metrics Stream
https://cloud.spring.io/spring-cloud-static/Brixton.SR7/
如果你想使用Hystrix Metrics Stream,你需要加这个依赖,我们不加这个项目都启动不起来,
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
To enable the Hystrix metrics stream include a dependency on spring-boot-starter-actuator.
This will expose the /hystrix.stream as a management endpoint.
localhost:8010/hystrix.stream
localhost:8010/movie/1
访问一下就有结果了
hystrix.stream他其实是一种监控,监控每一个API,比如线程,还有一一些其它的信息,断路器是否打开了,
那这个消息其实很难阅读的,我们到时会讲一个dashboard,我们把movie加上hystrix,feign怎么玩呢,他也
可以支持用这样的方法,Feign也是支持Hystrix的