Spring Cloud (10) Hystrix-监控面板
Hystrix DashBoard
断路器是根据一段时间窗内的请求状况来判断并操作断路器的打开和关闭状态的。Hystrix Dashboard是作为断路器状态的一个组件,提供了数据监控和友好的图形化界面。
这里使用第一篇创建的david-client项目,在pom.xml中添加相应的依赖:
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-hystrix</artifactId>
- </dependency>
在启动类中添加@EnableHystrix注解开启断路器,添加@EnableHystrixDashboard注解,开启Hystrix Dashboard
- @EnableHystrix
- @EnableHystrixDashboard
- @EnableEurekaClient
- @SpringBootApplication
- public class ClientApplication {
- public static void main(String[] args) {
- SpringApplication.run(ClientApplication.class, args);
- }
- }
在Controller中 声明断路点HystrixCommand
- @RestController
- public class TestController {
- @Value("${server.port}")
- String port;
- @GetMapping("/test")
- @HystrixCommand(fallbackMethod = "error")
- public String test() {
- return "test;port:" + port;
- }
- public String error(){
- return "error";
- }
- }
启动eureka-sever,eureka-client
访问 http://localhost:8762/hystrix
这是Hystrix Dashboard监控首页,该页面中并没有具体的监控信息,Dashboard共支持三种不同的监控方式:
1.默认的集群监控:通过url http://turbine-hostname:port/turbine.stream开启,实现对默认集群的监控。
2.指定的集群监控:通过url http://turbine-hostname:port/turbine.stream?cluster=[clusterName]开启,实现对clusterName集群的监控。
3.单体应用的监控:通过url http://hystrix-app:port/hystrix.stream开启,实现对具体某个服务实例的监控。
前两者都是对集群的监控,需要整合Turbine才能实现。最后一个是单个服务实例的监控。
delay:此参数用来控制服务器上轮询监控信息的延迟时间,默认为2000毫秒。
title:该参数为下图Hystrix Stream的内容,不添加显示监控的url。
在框框中输入:http://localhost:8762/hystrix.stream 、 2000 、 miya 然后点击Monitor Stream按钮
实心圆:有两种含义,他通过颜色代表了实例的健康程序,健康从绿色、黄色、橙色、红色递减。除了颜色变化也会根据流量发生变化,流量越大,圆越大。
曲线:用来记录2分钟内流浪的相对变化。
其他参数:
Spring Cloud (10) Hystrix-监控面板的更多相关文章
- 从零开始学spring cloud(十一) -------- hystrix监控
一.官方文档阅读 服务启动后,可以通过/health和hystrix.stream查看效果,实际上,访问上述两个地址,会出现404,这是因为spring boot版本的问题, 我在这里使用的sprin ...
- Spring Cloud(五):Hystrix 监控面板【Finchley 版】
Spring Cloud(五):Hystrix 监控面板[Finchley 版] 发表于 2018-04-16 | 更新于 2018-05-10 | 在上一篇 Hystrix 的介绍中,我们提到 ...
- spring cloud(五) hystrix
开启feign 熔断 hystrix 整合hystrix-dashboard监控面板 1. 服务调用者boot工程 pom引入依赖 <!-- hystrix-dashboard 监控依赖 ...
- Spring Cloud中Hystrix、Ribbon及Feign的熔断关系是什么?
导读 今天和大家聊一聊在Spring Cloud微服务框架实践中,比较核心但是又很容易把人搞得稀里糊涂的一个问题,那就是在Spring Cloud中Hystrix.Ribbon以及Feign它们三者之 ...
- Spring Cloud中Hystrix 线程隔离导致ThreadLocal数据丢失问题分析
最近spring boot项目中由于使用了spring cloud 的hystrix 导致了threadLocal中数据丢失,其实具体也没有使用hystrix,但是显示的把他打开了,导致了此问题. 导 ...
- spring cloud Hystrix监控面板Hystrix Dashboard和Turbine
我们提到断路器是根据一段时间窗内的请求情况来判断并操作断路器的打开和关闭状态的.而这些请求情况的指标信息都是HystrixCommand和HystrixObservableCommand实例在执行过程 ...
- Spring Cloud架构教程 (一)Hystrix监控面板
下面我们基于之前的示例来结合Hystrix Dashboard实现Hystrix指标数据的可视化面板,这里我们将用到下之前实现的几个应用,包括: eureka-server:服务注册中心 eureka ...
- Spring Cloud(三) --- hystrix
Hystrix 说到Hystrix就得先说一下产生的背景等等,那就是雪崩效应. 在微服务中肯定存在多个服务层之间的调用,基础服务的故障可能会导致级联故障,进而造成整个系统不可用的情况,这种现象被称为服 ...
- Spring Cloud断路器Hystrix
在微服务架构中,存在着那么多的服务单元,若一个单元出现故障,就会因依赖关系形成故障蔓延,最终导致整个系统的瘫痪,这样的架构相较传统架构就更加的不稳定.为了解决这样的问题,因此产生了断路器模式. 什么是 ...
随机推荐
- Springboot 添加数据源报错
报错信息如下: Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying be ...
- (13)Corner Detection角点检测
import cv2 import numpy as np img=cv2.imread('opencv-corner-detection-sample.jpg') gray = cv2.cvtCol ...
- vim下多行注释与解注释
1.多行注释 (1)按esc进入命令行模式 (2)按下Ctrl+v,进入区块模式,并使用上下键选择需要注释的多行 (3)按下“I”(大写)键,进入插入模式 (4)输入注释符(“//”或“#”等) (5 ...
- 洛谷—— P2658 汽车拉力比赛
https://www.luogu.org/problem/show?pid=2658 题目描述 博艾市将要举行一场汽车拉力比赛. 赛场凹凸不平,所以被描述为M*N的网格来表示海拔高度(1≤ M,N ...
- tomcat上传图片失败
今天,突然遇到个奇怪的问题,tomcat上传图片时好时坏,经查线上四台服务有一台服务器硬盘满了. 解决一下硬盘空间的问题,有好使了,那么图片上传通过流写到远程对象存储服务中,并没有落盘和硬盘满有哪些关 ...
- Angularjs中比较实用的DateFormat库
angular.module('newApp') .factory('dateUtil', function() { var symbolMap = { 'MM': function(date) { ...
- Stuts2的"struts.devMode"设置成true后,不起作用的解决的方法
不用 <constant name="struts.devMode" value="true" /> 改成 <constant name=& ...
- stl空间配置器alloc
new运算包含两阶段操作: 1) 调用::operator new分配内存 2) 调用构造函数构造对象内容 delete运算包含两阶段操作: 1)调用析构函数将对象析构 2)调用::op ...
- [Dart] Understand Variables and Constants in Dart
In this lesson, we will look at how to create variables and constants. These are containers that sto ...
- The return type is incompatible with JspSourceDependent.getDependants():JasperException问题分析与解决方法
Linux下基于JSP的报表集成到项目中后,显示不出来,查看tomcat的日志.有例如以下报错信息: The return type is incompatible with JspSourceDep ...