zoukankan      html  css  js  c++  java
  • 开启turbine收集hystrix指标功能

    使用turbine收集hystrix指标

    1、pom中引入对turbin的依赖,并增加dashboard图形界面的展示

    	<dependencies>
    	<dependency>
    		<groupId>org.springframework.boot</groupId>
    		<artifactId>spring-boot-starter-actuator</artifactId>
    	</dependency>
    	<dependency>
    		<groupId>org.springframework.cloud</groupId>
    		<artifactId>spring-cloud-starter-turbine</artifactId>
    	</dependency>
    	<dependency>
    		<groupId>org.springframework.cloud</groupId>
    		<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
    	</dependency>
    	<dependency>
    		<groupId>org.springframework.boot</groupId>
    		<artifactId>spring-boot-starter-test</artifactId>
    		<scope>test</scope>
    	</dependency>
    </dependencies>
    

    2、配置配置文件,设置需要收集指标的服务

    # 配置Eureka中的serviceId列表, 表明监控哪些服务
    turbine.app-config=ms-provider
    # 指定聚合哪些集群, 多个使用","分割, 默认为default.
    # 可使用http://.../turbine.stream?cluster={clusterConfig之一}访问
    turbine.aggregator.cluster-config=default
    turbine.cluster-name-expression=new String("default")
    turbine.instanceUrlSuffix=manage/hystrix.stream
    

    3、设置启动类

    @SpringBootApplication
    @EnableHystrixDashboard
    @EnableTurbine
    public class MsDashboardApplication {
    	// 直接监控某服务的hystrix: http://localhost:10000/hystrix.stream
    
    	// DashBoard: http://localhost:10000/hystrix
    	// 单台监控:在界面输入 http://localhost:10000/hystrix  
    	// 多台监控(通过turbine):http://localhost:10000/turbine.stream
    	public static void main(String[] args) {
    		SpringApplication.run(MsDashboardApplication.class, args);
    	}
    }
    

    说明: @EnableTurbine开启turbine的支持、@EnableHystrixDashboard允许使用图形化的界面展示。

    至此,就就完成了turbine收集指标的准备工作。

  • 相关阅读:
    【剑指offer】把字符串转换成整数
    【剑指offer】不用加减乘除做加法
    【剑指offer】求1+2+3+...+n
    【剑指offer】孩子们的游戏(圆圈中最后剩下的数)
    【剑指offer】扑克牌顺子
    【剑指offer】翻转单词顺序列
    【剑指offer】左旋转字符串
    【剑指offer】和为S的两个数字
    【剑指offer】和为S的连续正数序列
    2019.1.10 Mac安装Nginx服务器
  • 原文地址:https://www.cnblogs.com/liangzs/p/8550175.html
Copyright © 2011-2022 走看看