Hystrix DashBoard 监控配置方式以及 Hystrix.stream 404 问题

本文详细介绍了如何配置Spring Cloud应用以使用Hystrix Dashboard进行监控,包括所需依赖、YAML配置及启动类注解。针对Hystrix.stream 404问题,提供了正确的路径配置解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

在这里插入图片描述

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值