Hystrix DashBoard 监控配置方式以及 Hystrix.stream 404 问题
配置 Hystrix DashBoard
Spring Cloud 版本:Spring Cloud Finchley 或者 Greenwich.SR2
三个依赖:
- spring-cloud-starter-netflix-hystrix
- spring-boot-starter-actuator
- spring-cloud-starter-netflix-hystrix-dashboard
application.yaml 配置文件增加
management:
endpoints:
web:
exposure:
include: hystrix.stream
启动类增加注解 @EnableHystrixDashboard
@SpringBootApplication
@EnableDiscoveryClient
@EnableHystrix
@EnableHystrixDashboard
public class HystrixClientBootstrap {
public static void main(String[] args) {
new SpringApplicationBuilder(HystrixClientBootstrap.class)
.web(WebApplicationType.SERVLET)
.run(args);
}
}
截图:
浏览器输入:http://127.0.0.1:8381/hystrix.stream,报错 404
监控页面也没有信息
解决方案
http://127.0.0.1:8381/hystrix.stream(很多书籍和文档会使用这个路径,可能是版本原因)
修改为
http://127.0.0.1:8381/actuator/hystrix.stream