Hystrix监控问题
Hystrix监控问题:
pom.xml:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
在q启动类上加上注解:
@SpringBootApplication
@EnableHystrixDashboard
启动后:访问 http://127.0.0.1:8030/hystrix.stream 没问题
监控某个服务时:一致出现loading
解决:1.手动访问监控的API
2.更换浏览器(google)
3.application.properties在配置中加入:management.endpoints.web.exposure.include="*"
二:使用Turbine监控
需要添加依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
在启动类上加上注解:
@SpringBootApplication
@EnableHystrixDashboard
@EnableTurbine

浙公网安备 33010602011771号