Spring Cloud引入Hystrix Dashboard监控工具
2019-01-29 17:05
337 查看
Hystrix Dashboard是一款针对Hystrix进行实时监控的工具,通过Hystrix Dashboard我们可以在直观地看到各Hystrix Command的请求响应时间,请求成功率等数据。
前提:服务提供者、消费者均需要引入actuator包,需要引入Hystrix熔断,主类增加启动熔断注解EnableCircuitBreaker
服务提供者
HystrixConfig.java
@Configuration public class HystrixConfig { // 解决spring boot 2.0如下提示的问题 // Unable to connect to Command Metric Stream @Bean public ServletRegistrationBean getHystrixBean() { ServletRegistrationBean hystrix = new ServletRegistrationBean( new HystrixMetricsStreamServlet(), "/hystrix.stream"); hystrix.setName("hystrixServlet"); hystrix.setLoadOnStartup(1); return hystrix; } }
服务消费者
HystrixConfig.java 同上
服务注册中心
pom.xml
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> <version>1.4.6.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId> <version>1.4.6.RELEASE</version> </dependency>
CloudApplication.java 启用Hystrix Dashboard注解
@SpringBootApplication @EnableEurekaServer @EnableHystrixDashboard public class CloudApplication { public static void main(String[] args) { SpringApplication.run(CloudApplication.class, args); } }
测试
hystrix 监控地址http://cos6743:9000/hystrix
主界面中输入http://cos6743:8081/hystrix.stream或http://cos6743:8082/hystrix.stream
但需要模拟调用接口,否则一直是loading
相关文章推荐
- Spring Cloud学习--容错机制(Hystrix DashBoard之数据监控)
- Spring Cloud——断路器监控Hystrix Dashboard&Turbine
- Spring Cloud引入Turbine监控工具
- Spring Cloud(五)断路器监控(Hystrix Dashboard)
- spring cloud-添加Hystrix Dashboard监控到系统中
- Spring Cloud 入门教程(八): 断路器指标数据监控Hystrix Dashboard 和 Turbine
- springcloud(五):熔断监控Hystrix Dashboard和Turbine
- 史上最简单的SpringCloud教程 | 第十二篇: 断路器监控(Hystrix Dashboard)
- 史上最简单的SpringCloud教程 | 第十二篇: 断路器监控(Hystrix Dashboard)
- Spring Cloud中Hystrix仪表盘与Turbine集群监控
- Dashboard Hystrix 服务监控
- spring cloud-添加Hystrix Dashboard监控到系统中
- 史上最简单的SpringCloud教程 | 第十二篇: 断路器监控(Hystrix Dashboard)
- Spring Cloud构建微服务架构Hystrix监控面板
- Spring Boot + Spring Cloud 构建微服务系统(五):熔断监控面板(Hystrix Dashboard)
- spring cloud熔断监控Hystrix Dashboard和Turbine
- Spring Cloud架构教程 (一)Hystrix监控面板
- 企业级 SpringCloud 教程 (十二) 断路器监控(Hystrix Dashboard)
- 史上最简单的SpringCloud教程 | 第十二篇: 断路器监控(Hystrix Dashboard)
- springcloud(5):熔断监控Hystrix Dashboard和Turbine