Hystrix Turbine

xiaoxiao2025-04-23  6

  Hystrix Dashboard 在集群环境下的作用基本上可以忽略,所以需要一种方式来聚合整个集群下的监控状况,Turbine就是用来聚合所有相关的 hystrix.stream 流的解决方案,最后在 Hystrix Dashboard 中显示出来。

新增依赖 <!-- Spring Cloud Hystrix Turbine --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-turbine</artifactId> </dependency> 启动类上开启 Turbine /** * @Author:大漠知秋 * @Description:Hystrix Dashboard 服务启动入口 * @CreateDate:11:27 AM 2018/10/29 */ @SpringBootApplication /** 开启服务发现 */ @EnableDiscoveryClient /** 开启 Hystrix Dashboard 监控功能 */ @EnableHystrixDashboard /** 开启 Hystrix 集群监控 */ @EnableTurbine public class DemoHystrixDashboardApplication { public static void main(String[] args) { SpringApplication.run(DemoHystrixDashboardApplication.class, args); } } 新增配置信息: ### Hystrix Turbin 配置 turbine: app-config: demo-goods,demo-order cluster-name-expression: "'default'"

  注意:要在被监控的项目中开启端点 hystrix.stream

  最后结果:

源码:https://github.com/SlowSlicing/demo-spring-cloud-finchley/tree/HystrixTurbine

转载请注明原文地址: https://www.6miu.com/read-5028942.html

最新回复(0)