版本号:hystrix-dashboard:2.2.5.RELEASE
1、配置文件
hystrix:
dashboard:
proxy-stream-allow-list: "localhost"
2、在被监测的服务的主类或者配置类加入如下方法
/**
* Hystrix 仪表盘检测
* @return
*/
@Bean
public ServletRegistrationBean getServlet() {
HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
registrationBean.setLoadOnStartup(1);
registrationBean.addUrlMappings("/actuator/hystrix.stream");
registrationBean.setName("HystrixMetricsStreamServlet");
return registrationBean;
}
3、进入仪表盘
4、大功告成
注意:如果是loading,就去访问一下被监测的微服务进行刷新