Unable to connect to Command Metric Stream. 问题解决

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/fxbin123/article/details/82322476

初次使用SpringCloud Hystrix DashBoard 会出现 Unable to connect to Command Metric Stream

这里写图片描述

通过启动信息可以看到,
http://localhost:8181/actuator/hystrix.stream 是404 ,说明在SpringCloud Finchley.SR1 版本中,该访问路径是默认不开启的,所以我们需要手动开启昂

2018-09-03 00:34:19.382  WARN 29124 --- [nio-8181-exec-2] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:8181/actuator/hystrix.stream : 404 : HTTP/1.1 404 
2018-09-03 00:34:19.382  WARN 29124 --- [nio-8181-exec-1] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:8181/actuator/hystrix.stream : 404 : HTTP/1.1 404 

application.yml 文件中增加以下配置:

#暴露全部的监控信息
management:
  endpoints:
    web:
      exposure:
        include: "*"

此时再次启动,发现上述错误已经没有了,再次访问监控面板,是loading 状态。。。
这里写图片描述

调用feign 服务API,再次查看界面,在 Dashboard 界面即可看到 Hystrix 监控界面:

这里写图片描述

参考文章:
https://www.cnblogs.com/mark7/p/8920288.html
https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-security-actuator

猜你喜欢

转载自blog.csdn.net/fxbin123/article/details/82322476