Hystrix Turbine

本文介绍如何使用Turbine聚合Hystrix.stream流,实现Spring Cloud微服务集群的集中监控。通过配置Turbine,可以将多个服务实例的监控数据汇总到HystrixDashboard中进行统一展示,提升故障诊断效率。

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

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

  1. 新增依赖
<!-- Spring Cloud Hystrix Turbine -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>
  1. 启动类上开启 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);
    }

}
  1. 新增配置信息:
### 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值