hystrix.stream端点无法访问404问题

问题描述:
在项目中集成断路器监控的时候,访问/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:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_46266503/article/details/106061025