Hystrix Health Indicator及Metrics Stream支持

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的

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值