目录
启动类添加@EnableHystrixDashboard注解
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>
启动类添加@EnableHystrixDashboard注解
在主程序启动类中加入@EnableHystrixDashboard注解,开启hystrixDashboard:
@SpringBootApplication
@EnableDiscoveryClient
@EnableHystrix
@EnableHystrixDashboard
public class ServiceRibbonApplication {
..//代码省略
}
浏览器访问
打开浏览器:访问http://server:port/hystrix,界面如下
输入以下红色区域内容:
点击monitor stream,进入下一个界面,访问:http://localhost:8764/hi?name=forezp
此时会出现监控界面: