问题描述:
在项目中集成断路器监控的时候,访问/actuator/htstrix.stream经常会遇到404问题,如下图所示:
分析解决:
1.检查确认否引入了spring-boot-starter-actuator依赖。另外,spring-boot-starter-actuator、spring-cloud-starter-netflix-hystrix、spring-cloud-starter-netflix-hystrix-dashboard三个依赖,缺一不可。:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
2.检查application.yml配置是否引入以下内容:
management:
endpoints:
web:
exposure:
include: hystrix.stream
3.检查启动类是否启用dashboard:
@EnableHystrixDashboard
4.访问hystrix.stream: