前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Hystrix Dashboard熔断监控面板-微服务架构

Hystrix Dashboard熔断监控面板-微服务架构

作者头像
低调小熊猫
发布2020-06-07 10:47:31
7140
发布2020-06-07 10:47:31
举报
文章被收录于专栏:低调小熊猫

Hystrix Dashboard熔断监控面板-微服务架构

Hystrix-dashboard是一款针对Hystrix进行实时监控的工具,通过Hystrix Dashboard我们可以在直观地看到各Hystrix Command的请求响应时间, 请求成功率等数据。

注册中心:https://github.com/java-aodeng/hope/tree/master/micro-service1-eureka-server

服务提供者:https://github.com/java-aodeng/hope/tree/master/micro-service2-eureka-provider

服务消费者:https://github.com/java-aodeng/hope/tree/master/micro-service5-feign

这里以上面的注册中心,服务提供者,服务消费者为基础操作后续内容(代码已经开源,使用见文章)

创建HystrixDashboard项目

1.添加依赖

代码语言:javascript
复制
        <dependency>            <groupId>org.springframework.cloud</groupId>            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>        </dependency>        <!--hystrix-->        <dependency>            <groupId>org.springframework.cloud</groupId>            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>        </dependency>        <!--hystrix dashboard-->        <dependency>            <groupId>org.springframework.cloud</groupId>            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>        </dependency>        <dependency>            <groupId>org.springframework.boot</groupId>            <artifactId>spring-boot-starter-test</artifactId>            <scope>test</scope>        </dependency>

2.配置yml文件

代码语言:javascript
复制
#Hystrix Dashboard监控面板server:  port: 8889spring:  application:    name: eureka-hystrixdashboardeureka:  client:    serviceUrl:      defaultZone: http://localhost:8761/eureka/      #healthcheck:      #enabled: true  #开启自定义健康检查  instance:    #eureka服务器在接收到最后一个心跳之后等待的时间,然后才能从列表中删除此实例 默认90s(开发环境)    lease-expiration-duration-in-seconds: 10    #eureka客户端需要向eureka服务器发送心跳的频率 默认30s (开发环境)    lease-renewal-interval-in-seconds: 1#开启hystrix 指标feign:  hystrix:    enabled: true

3.启动入口添加注解

代码语言:javascript
复制
@SpringBootApplication@EnableEurekaClient@EnableHystrixDashboardpublic class MicroService6HystrixdashboardApplication {    public static void main(String[] args) {        SpringApplication.run(MicroService6HystrixdashboardApplication.class, args);    }}

配置消费者eureka-feign项目

1.添加依赖

代码语言:javascript
复制
        <!--监控中心-->        <dependency>            <groupId>org.springframework.boot</groupId>            <artifactId>spring-boot-starter-actuator</artifactId>        </dependency>

2.配置yml文件

代码语言:javascript
复制
# 端点管理 hystrixDashboardmanagement:  endpoints:    web:      exposure:        include: "*"

启动项目测试

依此启动注册中心eureka-server,服务提供者eureka-provider,服务消费者eureka-feign,服务监控面板eureka-hystrixdashboard

1.访问监控面板 http://192.168.0.108:8889/hystrix 出现一只熊猫的页面 this is 服务监控面板eureka-hystrixdashboar

2.访问服务消费者 http://192.168.0.108:8888/testByParam/1 多访问几次

3.访问监控面板 http://192.168.0.108:8889/hystrix 在箭头1输入 http://192.168.0.108:8888/actuator/hystrix.stream 点击箭头2 出现如下图成

最后

但是只使用Hystrix Dashboard的话, 你只能看到单个应用内的服务信息, 这明显不够. 我们需要一个工具能让我们汇总系统内多个服务的数据并显示到Hystrix Dashboard上, 这个工具就是Turbine. 咳咳,正在研究,有点懵逼。。。

(图片微信公众号识别不出来,原文看我博客)

源码永久开源地址

https://github.com/java-aodeng/hope/tree/master/micro-service6-hystrixdashboard

  • 本文作者: 低调小熊猫
  • 本文链接: https://aodeng.cc/archives/1552917185222
  • 版权声明: 本博客所有文章除特别声明外,均采用CC BY-NC-SA 3.0 许可协议。转载请注明出处!
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2019-03-18,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 低调小熊猫 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Hystrix Dashboard熔断监控面板-微服务架构
  • 创建HystrixDashboard项目
  • 配置消费者eureka-feign项目
  • 启动项目测试
  • 最后
  • 源码永久开源地址
相关产品与服务
微服务引擎 TSE
微服务引擎(Tencent Cloud Service Engine)提供开箱即用的云上全场景微服务解决方案。支持开源增强的云原生注册配置中心(Zookeeper、Nacos 和 Apollo),北极星网格(腾讯自研并开源的 PolarisMesh)、云原生 API 网关(Kong)以及微服务应用托管的弹性微服务平台。微服务引擎完全兼容开源版本的使用方式,在功能、可用性和可运维性等多个方面进行增强。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档