spring cloud dashboard 连接不上

spring cloud 项目添加了仪表盘,但一直连接不上
Unable to connect to Command Metric Stream.

image.png

后面发现控制台中有一行警告日志
WARN 23796 --- [nio-8080-exec-1] ashboardConfiguration$ProxyStreamServlet : Origin parameter: http://localhost:8080/actuator/hystrix.stream is not in the allowed list of proxy host names. If it should be allowed add it to hystrix.dashboard.proxyStreamAllowList.
image.png

估计是新的版本的原因
我用的版本如下

# springboot :
<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.7.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
 </parent>
# spring-cloud
<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Hoxton.SR9</version>
            <type>pom</type>
            <scope>import</scope>
</dependency>

解决方式
配置文件中添加配置

hystrix:
  dashboard:
    proxy-stream-allow-list: "*"

添加配置重启


image.png

image.png

完成

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容