随笔 - 1357  文章 - 0  评论 - 1104  阅读 - 1941万

SpringCloud断路器监控面板——Hystrix Dashboard

一、简介
Hystrix Dashboard是Hystrix的一个组件,Hystrix Dashboard提供一个断路器的监控面板,可以使我们更好的监控服务和集群的状态,仅仅使用Hystrix Dashboard只能监控到单个断路器的状态,实际开发中还需要结合Turbine使用。

二、Hystrix Dashboard的使用
1、添加依赖

复制代码
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
复制代码

2、Springboot Application中添加注解,并启动程序

@EnableHystrixDashboard //开启Dashboard

3、查看面板

/health端点查看服务状态
/hystrix.stream端点查看指标流


浏览器中打开http://localhost:9999/hystrix

图中提示数据源有三种:
http://turbine-hostname:port/turbine.stream (所有集群)
http://turbine-hostname:port/turbine.stream?cluster=[clusterName](指定名称的集群)
http://hystrix-app:port/hystrix.stream(单个应用)
我们选择第三个,点击Moitor Stream会自动生成监控面板,我们就可以实时监控数据

如果处于loading data状态,是因为没有数据,调用服务就可以加载数据了。


注意:在Feign负载均衡中使用Hystrix Dashboard,一定需要配置打开断路器,如下:

feign.hystrix.enabled=true

 

posted on   Ruthless  阅读(2111)  评论(0编辑  收藏  举报
编辑推荐:
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· 写一个简单的SQL生成工具
· AI 智能体引爆开源社区「GitHub 热点速览」
· C#/.NET/.NET Core技术前沿周刊 | 第 29 期(2025年3.1-3.9)
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示