需要被监控的微服务工程pom依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
yml中
management.endpoints.web.exposure.include: hystrix.stream
监控工程pom依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
yml中配置
服务端口号
server.port
微服务名称
spring.application.name
启动类上使用注解 启用Hystrix监控仪表盘功能


@EnableHystrixDashboard

通过监控工程端口号+/hystrix
http://localhost:xxxx/hystrix访问hystrix网站
红色箭头所指位置写入被监控的微服务地址
http://localhost:xxxx/hystrix.system


注:如要查看监控数据本身(json)
直接访问http://localhost:xxxx/hystrix.system
xxxx:具体微服务端口
如果此微服务启动开始后方法没有被访问过,那么显示的数据只有Ping,必须访问带有熔断的方法才会有实际数据
posted on 2020-04-04 20:03  ha1998  阅读(174)  评论(0编辑  收藏  举报