spring cloud 项目添加了仪表盘,但一直连接不上
Unable to connect to Command Metric Stream.
后面发现控制台中有一行警告日志
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
完成
网友评论