解决Unable to connect to Command Metric Stream问题:Hystrix Dashboard 一直是Loading ...的情况

1.Hystrix Dashboard是正常打开的

2.查看Hystrix对服务监控时,一直是loading...... 最终显示Unable to connect to Command Metric Stream.

经过多次排查是没有错的。

Hystrix Dashboard 监控工程

第一:Hystrix Dashboard工程里的pom添加如下依赖:

<!--hystrix和hystrix-dashboard相关 -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
        </dependency>

第二:工程的主启动类上增加@EnableHystrixDashboard

@EnableHystrixDashboard
public class DeptConsumer_DashBoard_App {

被监控的服务工程:

第一:pom文件添加 :

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix</artifactId>
        </dependency>

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        

第二:针对提供的服务方法的controller里要添加 了熔断处理如下:

@HystrixCommand(fallbackMethod="processHystrix_Get")
    public Dept get(@PathVariable("id") Long id)
    {

最后发现还是个一直loading......

再次打开一个服务消费工程,访问一下提供的服务接口(注意:这里一定要访问一下添加了@HystrixCommand注解的方法

最后成功出现监控图。

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值