Unable to connect to Command Metric Stream 'api/turbine/stream?cluster=REPORTS' Error: {"isTrusted"}

今天药忘吃喽~ 2022-05-13 09:10 187阅读 0赞

Spring Boot Admin 整合Hystrix UI Module,Turbine UI Module.

报如下错误:

format_png首先确保你的admin-server引入了一下的依赖:

  1. <!--引入hystrix -->
  2. <dependency>
  3. <groupId>de.codecentric</groupId>
  4. <artifactId>spring-boot-admin-server-ui-hystrix</artifactId>
  5. <version>1.5.7</version>
  6. </dependency>
  7. <!--引入turbine -->
  8. <dependency>
  9. <groupId>de.codecentric</groupId>
  10. <artifactId>spring-boot-admin-server-ui-turbine</artifactId>
  11. <version>1.5.7</version>
  12. </dependency>

application.propertes添加如下配置:

  1. spring.boot.admin.routes.endpoints=env,metrics,dump,jolokia,info,configprops,trace,logfile,refresh,flyway,liquibase,heapdump,loggers,auditevents,hystrix.stream
  2. spring.boot.admin.turbine.clusters=default
  3. #turbine服务id,turbine服务可以作为单独的服务
  4. #Turbine服务器的ServiceId或URL(不包含/turbine.stream)。 必须可以从管理服务器访问。
  5. spring.boot.admin.turbine.location=hystrix-dashboard-turbine

对于spring.boot.admin.turbine.location 的配置默认为‘turbine’服务。 Turbine服务器配置可以是serviceId或者是URL(具体可以参考官方文档)

上面的hystrix-dashboard-turbine是我turbine服务器的servceId.具体不懂可参考https://blog.csdn.net/niugang0920/article/details/80107804

其实底层是用Hystrix进行实施监控的。HystrixCommand和HystrixObservableCommand在执行时,会生成执行结果和运行指标,比如每秒执行的请求数、成功等。

其实就是对方法上的@HystrixCommand进行监控。

70

上述配置正确就ok了。

70 1

  1. ** 微信公众号: **
  2. ![20180403143416927][]
  3. JAVA程序猿成长之路
  4. 分享资源,记录程序猿成长点滴。专注于Java,Spring,SpringBoot,SpringCloud,分布式,微服务。

发表评论

表情:
评论列表 (有 0 条评论,187人围观)

还没有评论,来说两句吧...

相关阅读