SpringCloud浅尝(九)——Hystrix Dashboard

hystrix-dashboard是一个可视化的熔断监视工具,我们来看看如何在项目中使用这个工具。我们用新建一个项HystrixDashboard

,增加如下依赖:spring-cloud-starter-netflix-hystrix-dashboard、spring-boot-starter-actuator

,并在启动类中添加@EnableHystrixDashboard注解

@SpringBootApplication
@EnableHystrixDashboard
public class HystrixDashboardApplication {

	public static void main(String[] args) {
		SpringApplication.run(HystrixDashboardApplication.class, args);
	}

}

 

http://localhost:8021/hystrix

通过Hystrix Dashboard主页面的文字介绍,我们可以知道,Hystrix Dashboard共支持三种不同的监控方式

默认的集群监控:通过URL:http://turbine-hostname:port/turbine.stream开启,实现对默认集群的监控。

指定的集群监控:通过URL:http://turbine-hostname:port/turbine.stream?cluster=[clusterName]开启,实现对clusterName集群的监控。

单体应用的监控:通过URL:http://hystrix-app:port/hystrix.stream开启,实现对具体某个服务实例的监控。

Delay:控制服务器上轮询监控信息的延迟时间,默认为2000毫秒,可以通过配置该属性来降低客户端的网络和CPU消耗。

Title:合适展示的标题。

我们就用它来监控一下,前面EurekaDiscovery2实例,EurekaDiscovery2中引入spring-boot-starter-actuator,并在配置文件中

暴露hystrix.stream的监控点地址,添加management.endpoints.web.exposure.include=hystrix.stream属性

management:
  endpoints:
    web:
      exposure:
        include: hystrix.stream

我们在上面的页面中输入,http://localhost:8003/actuator/hystrix.stream

进入就可以看到这个页面了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值