当前位置:网站首页>Turbine Aggregation Monitoring
Turbine Aggregation Monitoring
2022-07-29 16:33:00 【Big dream who realizes i】
一、搭建监控模块
1. Create the monitoring module
创建hystrix-monitor模块,使用TurbinePolymerization monitoring multipleHystrix dashboard功能,
2. 引入TurbinePolymerization started monitoring rely on
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>hystrix-parent</artifactId>
<groupId>com.test</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hystrix-monitor</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
3. 修改application.yml
spring:
application.name: hystrix-monitor
server:
port: 8769
turbine:
combine-host-port: true
# Configuration of the need to monitor the service name list
app-config: hystrix-provider,hystrix-consumer
cluster-name-expression: "'default'"
aggregator:
cluster-config: default
#instanceUrlSuffix: /actuator/hystrix.stream
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
4. 创建启动类
@SpringBootApplication
@EnableEurekaClient
@EnableTurbine //开启Turbine Very polymerization monitoring function
@EnableHystrixDashboard //开启HystrixThe dashboard monitoring function
public class HystrixMonitorApp {
public static void main(String[] args) {
SpringApplication.run(HystrixMonitorApp.class, args);
}
}
二、修改被监控模块
需要分别修改 hystrix-provider 和 hystrix-consumer 模块:
1、导入依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
2、配置Bean
此处为了方便,Be configured at startup class.
@Bean
public ServletRegistrationBean getServlet() {
HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
registrationBean.setLoadOnStartup(1);
registrationBean.addUrlMappings("/actuator/hystrix.stream");
registrationBean.setName("HystrixMetricsStreamServlet");
return registrationBean;
}
3、启动类上添加注解@EnableHystrixDashboard
@EnableDiscoveryClient
@EnableEurekaClient
@SpringBootApplication
@EnableFeignClients
@EnableHystrixDashboard // 开启HystrixThe dashboard monitoring function
public class ConsumerApp {
public static void main(String[] args) {
SpringApplication.run(ConsumerApp.class,args);
}
@Bean
public ServletRegistrationBean getServlet() {
HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
registrationBean.setLoadOnStartup(1);
registrationBean.addUrlMappings("/actuator/hystrix.stream");
registrationBean.setName("HystrixMetricsStreamServlet");
return registrationBean;
}
}
三、启动测试
1、启动服务:
eureka-server
hystrix-provider
hystrix-consumer
hystrix-monitor
2、访问:
在浏览器访问http://localhost:8769/hystrix/ 进入Hystrix Dashboard界面
Enter the monitoring interface ofUrl地址 http://localhost:8769/turbine.stream,监控时间间隔2000毫秒和title,如下图

实心圆:It has a color or size,Represent the instance of the monitoring level and the flow.如上图所示,它的健康度从绿色、黄色、橙色、红色递减.Through the solid circle show,我们就可以在大量的实例中快速的发现故障实例和高压力实例.
曲线:用来记录 2 分钟内流量的相对变化,我们可以通过它来观察到流量的上升和下降趋势.
边栏推荐
- 风格迁移篇----艺术风格转换的内容与风格解构
- 人脸关键点预测以及归一化
- win10 校验sha256
- ES6 从入门到精通 # 10:Set 集合数据类型
- [Designers must learn] Lighting skills of Enscape in SketchUp
- 6月阿里遭拒,90天深造357页微服务手册,获京东offer
- Twin all things digital visual | join the real world and the digital space
- See you in shenzhen!Cloud native to accelerate the application building special: see cloud native FinOps, SRE, high-performance computing scenario best practices
- 【C语言刷题】Leetcode268丢失的数字
- SAP ABAP OData 服务诊断工具 /IWFND/ERROR_LOG 的使用方法试读版
猜你喜欢

mysql的union和union all

Unable to open the source file in qt vs2015 "QtWidgets" solution

人脸关键点预测以及归一化

【Go语言刷题篇】Go完结篇函数、结构体、接口、错误入门学习

Alibaba 开源内网高并发编程手册

This article penetrates the architecture design and cluster construction of the distributed storage system Ceph (hands-on)

【微信小程序】组件使用及属性参考
![[MySQL] 运算符](/img/0b/e974cb461fc403de18545f7f9ac527.png)
[MySQL] 运算符

Qt learning on the first day

一文看懂分布式存储架构
随机推荐
6月阿里遭拒,90天深造357页微服务手册,获京东offer
电子元器件行业B2B交易系统:规范企业交易流程,提升销售管理效率
奇怪,为什么ArrayList初始化容量大小为10?
MySQL笔记下
我的 2019 年终总结
泰芯TXW8301打造新一代8路无线监控NVR套装解决方案
Recommended Remote Desktop Tools
图文结合纯c手写内存池
MQTT over QUIC:下一代物联网标准协议为消息传输场景注入新动力
中国大学慕课mooc答题/自动播放脚本(domooc)使用教程
如何创建NFT(还在创作中ing)
文档贡献与写作必读-OpenHarmony开发者文档风格指南
Shell script programming - operation
718. 最长重复子数组
JUL 学习
浮点数内存存储问题
微信公众号借助小程序云函数实现支付功能
风格迁移篇----艺术风格转换的内容与风格解构
理解 Web3 的权威指南
【小程序项目开发-- 京东商城】uni-app之商品列表页面 (上)