spring cloud2 hystrix没有/actuator/hystrix.stream路径解决

在启动类上加入

@EnableHystrix
@EnableCircuitBreaker
@EnableHystrixDashboard

在启动类中加入

@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;
}

你可能感兴趣的:(spring cloud2 hystrix没有/actuator/hystrix.stream路径解决)