`
raymond.chen
  • 浏览: 1442296 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Hystrix DashBoard监控面板

 
阅读更多

Hystrix-dashboard是一款针对Hystrix进行实时监控的工具,提供了数据监控和友好的图形化界面。通过Hystrix Dashboard可以直观地看到Hystrix的各项指标信息。通过Hystrix Dashboard反馈的实时信息,可以帮助我们快速发现系统中存在的问题。

 

Spring Cloud Hystrix Dashboard的底层原理是间隔一定时间去“Ping”目标服务,返回的结果是最新的监控数据,最后将数据显示出来。

 

Hystrix Dashboard监控单实例节点需要通过访问实例的/hystrix.stream端点来实现的,所以需要为服务实例添加这个端点。

 

 

 

为服务消费者工程添加/hystrix.stream端点

    在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-netflix-hystrix</artifactId>
</dependency>

 

 

    在启动类定义 ServletRegistrationBean 对象,配置hystix.stream端点

/**
 * SpringBoot2+版本需要手动配置hystrix.stream端点
 */
@Bean
public ServletRegistrationBean getServlet() {
	HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
	ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
	registrationBean.setLoadOnStartup(1);
	registrationBean.addUrlMappings("/hystrix.stream");
	registrationBean.setName("hystrixMetricsStreamServlet");
	return registrationBean;
}

 

 

    在浏览器访问hystix.stream端点,查看监控的指标信息

             http://localhost:9003/hystrix.stream


 

 

 

创建Hystrix DashBoard监控工程

    pom.xml文件关键配置:

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>2.0.7.RELEASE</version>
	<relativePath/>
</parent>

<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</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-actuator</artifactId>
	</dependency>
</dependencies>

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dependencies</artifactId>
			<version>Finchley.RELEASE</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

 

    启动类

    添加@EnableHystrixDashboard注解

@SpringBootApplication
@EnableHystrixDashboard //启用Hystrix Dashboard功能
public class Main {
	public static void main(String[] args) {
		SpringApplication.run(Main.class, args);
	}
}

 

    application.properties文件的配置

spring.application.name=hystrix-dashboard
server.port=6001

 

    运行该工程,在浏览器访问 http://localhost:6001/hystrix ,即可看到Hystrix Dashboard主界面


 

在主界面上输入一个服务消费者的hystix.stream端点地址,点击“Monitor Stream”按钮进行实时监控。仅使用Hystrix Dashboard只能监控到单个断路器的状态


 

监控页面详细说明如下图所示:


 

  • 大小: 270.9 KB
  • 大小: 49.6 KB
  • 大小: 45.3 KB
  • 大小: 30.7 KB
分享到:
评论

相关推荐

    Hystrix Dashboard的使用-代码部分.zip

    在微服务架构中,Hystrix Dashboard 和 Turbine 是两个重要的工具,用于监控服务的健康状态和性能。本文将深入探讨这两个组件,并结合提供的源代码,解析它们在实际项目中的应用。 **Hystrix Dashboard** Hystrix ...

    04Hystrix Dashboard:断路器执行监控1

    Hystrix Dashboard是Spring Cloud生态系统中的一个重要工具,用于实时监控HystrixCommand方法的执行状况。这个组件使得开发者能够直观地了解微服务架构中的断路器(Circuit Breaker)性能,及时发现并处理系统中的...

    hystrix-dashboard-1.5.12及说明.zip

    Hystrix Dashboard 是 Netflix 开源的一款用于监控服务容错管理工具 Hystrix 的可视化界面,版本号为 1.5.12。这款工具的核心目的是提供一个实时的监控视图,帮助开发者了解系统中的服务依赖以及它们之间的交互,...

    Hystrix-dashboard+turbine-web+说明文档

    本文将详细介绍这两个组件以及如何通过 `Hystrix-dashboard` 和 `turbine-web` 来实现有效的监控和聚合监控。 **Hystrix** 是 Netflix 开源的一个库,它旨在通过隔离请求、降级策略和熔断机制来保护服务免受级联...

    hystrix-dashboard.zip

    Hystrix Dashboard是Netflix开源的一款监控工具,它能够帮助我们实时监控微服务架构中的断路器状态,即Hystrix组件的工作情况。 【描述】提到的内容表明,这个压缩包可能包含了一个完整的示例项目,用于演示如何在...

    HystrixDashboard熔断器面板参数说明

    HystrixDashboard熔断器面板参数说明

    hystrix dashboard 1.5.6 jar

    Hystrix-Dashboard使用 运行nohup java -jar standalone-hystrix-dashboard-1.5.6-all.jar & 浏览器打开http://localhost:7979/hystrix-dashboard/  输入地址http://localhost/hystrix.stream 先点击 add stream ...

    standalone-hystrix-dashboard-1.5.6-all.zip

    Hystrix Dashboard是Netflix开源的一款强大的监控工具,用于可视化微服务架构中的断路器状态和服务性能。在本案例中,我们关注的是`standalone-hystrix-dashboard-1.5.6-all.zip`,这是一个独立的Hystrix Dashboard...

    Hystrix dashboard

    **Hystrix Dashboard 是一个监控工具,用于可视化微服务架构中的断路器状态和性能指标。在Spring Cloud框架中,Hystrix Dashboard 提供了一种实时监控应用内Hystrix命令执行情况的方式,有助于开发者更好地理解和...

    SpringCloud -Hystrix监控面板及数据聚合(Turbine)介绍与使用示例

    Hystrix Dashboard 和 Turbine 是配套的监控工具,帮助开发者实时监控服务的运行状态,确保系统的稳定性和高可用性。下面将详细介绍这两个工具的功能、使用方法以及集成步骤。 **Hystrix Dashboard** Hystrix ...

    HystrixDashboard的使用

    HystrixDashboard的基础使用

    SpringCloud10-2 Hystrix整合Dashboard教程

    在本教程中,我们将深入探讨如何在Spring Cloud项目中整合Hystrix Dashboard,这是一个强大的工具,用于监控微服务架构中的断路器性能。Hystrix是Netflix开源的一个库,它为分布式系统提供了延迟和容错的基础设施,...

    hystrix-dashboard-1.5.9.war

    springcloud hystrix-dashboard

    spring cloud hystrix &&dashboard源码解读

    ### Spring Cloud Hystrix & Dashboard 源码解读 #### 一、加载、初始化概要 ##### 1.1 @EnableCircuitBreaker 的生效 `@EnableCircuitBreaker` 注解是 Spring Cloud Hystrix 提供的一个关键注解,用于启动熔断器...

    SpringCloud之熔断监控Hystrix Dashboard的实现

    SpringCloud之熔断监控Hystrix Dashboard的实现 SpringCloud 是微服务中的翘楚,最佳的落地方案。SpringCloud 中的 Hystrix 组件可以实现熔断,而在实际情况中,一般还需要直观地看到各个服务的调用情况,这时,就...

    SpringCloud Hystrix-Dashboard仪表盘的实现

    SpringCloud Hystrix-Dashboard 仪表盘是 SpringCloud 中的一种监控工具,它可以实时监控 Hystrix 的各项指标信息。通过 Hystrix Dashboard 反馈的实时信息,可以帮助我们快速发现系统中存在的问题。 Hystrix ...

    微服务系统和数据库设计方案.docx

    Eureka、负载均衡、路由配置 ZUUL 网关、 feign 调用、断路器 hystrix、监控功能、SpringCloud Config 进行统一的配置管理、Hystrix 监控和断路器功能、Hystrix Dashboard 监控面板、Turbine 监控聚合等。...

    hystrix-dashboard jar包

    hystrix的监控可执行的jar包,可以同java -jar 直接运行

    springcloud 熔断监控Hystrix Dashboard和Turbine

    当我们在项目中引入`spring-cloud-starter-hystrix-dashboard`依赖后,可以通过访问Hystrix Dashboard来监控每个Hystrix命令的运行状态。在启动类中启用`@EnableHystrixDashboard`注解即可开启这个功能。 在上面的...

    hystrix-dashboar1.5.12

    Hystrix Dashboard 是 Netflix 开源的一款强大的监控工具,主要用于监控微服务架构中的 Hystrix 库的性能和健康状况。在标题提到的 "hystrix-dashboar1.5.12" 中,我们关注的是 Hystrix Dashboard 的一个特定版本...

Global site tag (gtag.js) - Google Analytics