踩了几个小时坑,使用仪表盘监控单个服务的时候很容易,可是一到多个服务,瞬间坑就来了,大概碰到下面三个:spring
1InstanceMonitor$MisconfiguredHostException, No message available","path":"/actuator/hystrix.stream:springboot
由于我用的是springboot2.0.6版本,这个版本默认路径不是/hystrix.stream,而turbine默认路径是这个,因此要修改一下,能够有两种修改方式:app
一: 配置Bean,设置路径测试
/** * springboot 版本若是是2.0则须要添加 ServletRegistrationBean * 由于springboot的默认路径不是 "/hystrix.stream" * @return */ @Bean public ServletRegistrationBean getServlet() { HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet(); ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet); registrationBean.setLoadOnStartup(1); registrationBean.addUrlMappings("/hystrix.stream"); registrationBean.setName("HystrixMetricsStreamServlet"); return registrationBean; }
二: 配置文件配置Beanspa
页面不显示服务:code
这个问题挺坑的,具体缘由是由于监控的服务不光要开启熔断和仪表盘,一样也要开启turbine,即启动类须要如下注解,缺一不可:
blog
一直loading:接口
最后是这个,实际中发现不管怎么访问接口,就是没监控数据,后台测试发现,你所访问的接口必需要有熔断,即普通方法要有fallback:get
访问其余方法是不会有监控数据的;it
feign接口也要有fallback实现类,才会监控到数据!!!!!!