spring cloud: Hystrix(八):turbine集群监控(dashboard)

turbine是聚合服务器发送事件流数据的一个工具,hystrix的监控中,只能监控单个节点,实际生产中都为集群,

因此可以通过turbine来监控集群下hystrix的metrics情况,通过eureka来发现hystrix服务。

dashboard可以监控单个数据流,通过turbine可以显示集群的数据流信息

turbine

引入turbine依赖

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-turbine</artifactId>
</dependency>	

  

在入口文件,加入TUrbine注解

@EnableTurbine

@EnableTurbine
@SpringBootApplication
public class TurbineApp {


	public static void main(String[] args) {
		SpringApplication.run(TurbineApp.class, args);
	}
}

  

在配置文件application.properties配置要监控的服务,注意要大写

turbine.aggregator.clusterConfig=SPRING-BOOT-MOVIE-RIBBON-HYSTRIX
turbine.appConfig=SPRING-BOOT-MOVIE-RIBBON-HYSTRIX

  

运行

大概开启的服务:spring-boot-user, spring-boot-turbine, spring-boot-movie-ribbon-hystrix:8010,8012

Turbine单个监控

通过访问spring-boot-movie-ribbon-hystrix:8010

然后监控:spring-boot-movie-ribbon-hystrix:8010

http://192.168.1.3:8031/turbine.stream?cluster=SPRING-BOOT-MOVIE-RIBBON-HYSTRIX

通过dashboard面板来查看,

dashboard地址是:http://localhost:8730/hystrix

将turbine监控的数量地址:

http://192.168.1.3:8031/turbine.stream?cluster=SPRING-BOOT-MOVIE-RIBBON-HYSTRIX

加入到dashboard的健康中去

turbine集群健康

猜你喜欢

转载自www.cnblogs.com/achengmu/p/9919647.html