1、简介
Hystrix Dashboard是一个通过收集actuator端点提供的Hystrix流数据,并将其图表化的客户端。如果需要通过图表化的界面查看被断路器保护的方法相关调用信息、或者实时监控这些被断路器保护的应用的健康情况,就可以使用Hystrix Dashboard。
2、正文
2.1 启动Hystrix Dashboard
创建一个Spring Boot项目添加Hystrix Dashboard 依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
在启动类上使用@EnableHystrixDashboard注解来启动Hystrix Dashboard
@SpringBootApplication
@EnableHystrixDashboard
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
指定Hystrix Dashboard服务启动端口
server:
port: 17777
启动服务,访问/hystrix端点,看到如下界面则证明Hystrix Dashboard启动成功