需要加入依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</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-hystrix</artifactId>
</dependency>
启动类上需要加入注解
@EnableHystrixDashboard
@EnableHystrix
访问:http://hystrix的ip:端口/hystrix
会进入小熊页面
输入地址
点击Monitor Stream会进入监控页面
浏览器访问一下服务的接口
就有了监控的信息
circuit表示熔断器的开关的状态:
- open表示开启(说明服务调用有问题)
- closed表示关闭