首页 > 其他分享 >[hystrix] hystrix-dashboard 关于 Unable to connect to Command Metric Stream 的问题解决方法

[hystrix] hystrix-dashboard 关于 Unable to connect to Command Metric Stream 的问题解决方法

时间:2022-09-26 01:11:04浏览次数:60  
标签:registrationBean hystrix Stream Metric HystrixMetricsStreamServlet dashboard 监控 

问题

在hystrix-dashboard界面中出现以下错误

解决方法

  1. 高版本(具体哪些版本之后我不知道,加上去试试)springcloud需要加以下配置(在被监控一端):
@Configuration
public class HystrixConfig {
    @Bean
    public ServletRegistrationBean getServlet() {
        HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
        registrationBean.setLoadOnStartup(1);
        registrationBean.addUrlMappings("/hystrix.stream");
        registrationBean.setName("HystrixMetricsStreamServlet");
        return registrationBean;
    }
}
  1. 被监控端pom文件添加以下依赖:
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
  1. 在被监控端配置文件添加以下配置(开放以下actuator监控权限):
management:
  endpoints:
    web:
      exposure:
        include: ["health","info","hystrix.stream"]
  1. 在hashboard端配置文件添加以下配置(运行访问熔断监控页面的地址):
hystrix:
  dashboard:
    proxy-stream-allow-list: "localhost"
  1. 还不行就再google吧...然后解决了就在底下更新

Extra

hystrix hashboard 不需要 eureka

标签:registrationBean,hystrix,Stream,Metric,HystrixMetricsStreamServlet,dashboard,监控,
From: https://www.cnblogs.com/qiuzhongyong/p/16729536.html

相关文章

  • [hystrix] fallback method wasn‘t found 异常
    问题程序报错fallbackmethodwasn'tfound:fallback2([classjava.lang.Integer])原因hystrix降级的fallback方法需要与原方法有相同的返回类型和参数列表,fallback......
  • [hystrix] 常用的HystrixCommand配置
    @HystrixCommand(fallbackMethod="fallback",//降级方法commandProperties={@HystrixProperty(name="circuitBreaker.enabled......
  • Java8Stream流
    Stream流呢,以前我也有所了解,像一些面试题中也出现过,Java8的新特性,有一块就是这个Stream操作集合,而且在看一些项目中也使用的比较多。但总感觉自己学的一知半解,所以今天打......
  • [hystrix]openfeign+hystrix反复进降级方法问题
    问题#开启服务降级feign:hystrix:enabled:true开启服务降级并设置降级fallback方法调用list方法时可以正常获取服务提供端返回的数据并返回给浏览器,但是......
  • 练习-集合元素处理传统方式和Stream方式
    练习-集合元素处理(传统方式)练习:集合元素处理(传统方式)现在有两个ArrayList集合存储队伍当中的多个成员姓名,要求使用传统的for循环(或增强for循环)依次进行以下......
  • Servicemonitor监控自带metrics接口和无metrics接口
    前言:servicemonitor监控存在两种情况:1、有metrics,创建service+servicemonitor配置2、无metrics 配置exporter,exporter进行采集 一、监控自带metrics接口①、部署......
  • Stream流中的常用方法skip和concat
    Stream流中的常用方法skipStream流中的常用方法_skip:用于跳过元素如果希望跳过前几个元素,可以使用skip方法获取一个截取之后的新流:Stream<T>skip(longn);......
  • Stream流中的常用方法limit和count
    Stream流中的常用方法limitStream流中的常用方法_count:用于统计Stream流中元素的个数longcount();count方法是一个终结方法,返回值是一个long类型的整数所以......
  • Hystrix断路器
    服务雪崩什么是雪崩?   多个微服务之间调用的时候,假设微服务A调用微服务B和微服务C,微服务B和微服务C又调用其他的微服务,这就是所谓的“扇出”、如果扇出的链路......
  • 吃透JAVA的Stream流操作,多年实践总结
    在JAVA中,涉及到对数组、Collection等集合类中的元素进行操作的时候,通常会通过循环的方式进行逐个处理,或者使用Stream的方式进行处理。例如,现在有这么一个需求:从给定句子......