spring cloud-添加Hystrix Dashboard监控到系统中

前言

该示例是在

spring cloud-使用Hystrix实现单个方法的fallback

示例的基础上改进

一、添加依赖

[html] view plain copy
  1. <dependency>  
  2.             <groupId>org.springframework.cloud</groupId>  
  3.             <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>  
  4.         </dependency>  
二、在启动类中添加Hystrix Dashboard支持

[java] view plain copy
  1. @EnableHystrix  
  2. @EnableHystrixDashboard  
三、在浏览器中输入http://localhost:7904/hystrix/

注意:端口号为具体服务对应的端口号而不是Eureka Server的端口号

spring cloud-添加Hystrix Dashboard监控到系统中

在浏览器中多次刷新http://localhost:7904/get/2地址,会出现如下监控页面

spring cloud-添加Hystrix Dashboard监控到系统中

官方Dashboard面板内容说明如下:

spring cloud-添加Hystrix Dashboard监控到系统中