gpt4 book ai didi

java - Hystrix仪表板

转载 作者:行者123 更新时间:2023-12-03 05:51:31 25 4
gpt4 key购买 nike

我对Hystrix完全陌生,但是我需要从中监视指标。

到目前为止,我有一个独立的显示器,用于显示/运行Hystrix仪表板。

在我的项目中,添加依赖项;

compile(group:"com.netflix.hystrix", name:"hystrix-metrics-event-stream", version:'1.5.5')
compile(group:"org.springframework.cloud", name:"spring-cloud-starter-hystrix-dashboard", version:'1.1.5.RELEASE')
compile(group:"org.springframework.boot", name:"spring-boot-starter-actuator", version:'1.4.0.RELEASE')
compile(group:"org.springframework.cloud", name:"spring-cloud-starter-hystrix", version:'1.1.5.RELEASE')

同样在我的SpringConfig中,我添加
@EnableHystrix
public class MyAppConfig {

@Bean
public ServletRegistrationBean servletRegistration() {
ServletRegistrationBean registration = new ServletRegistrationBean(new HystrixMetricsStreamServlet(), "/hystrix.stream");
return registration;
}
}

我成功启动了我可以检查它是否由localhost:8080 / health运行的服务,并得到了答案。

当我添加localhost:8080 / hystrix.stream并在Hystrix仪表板中短暂按下Monitor Streams按钮时,它显示“正在加载...”,但随后出现“无法连接到Command Metric Stream”。

我也在仪表板控制台中得到了这个。
17:19:26.858 [vert.x-eventloop-thread-0] INFO  c.g.k.h.c.s.d.HystrixDashboardProxyConnectionHandler - Proxing request to http://localhost:8080/hystrix.stream
17:19:31.879 [vert.x-eventloop-thread-0] ERROR c.g.k.h.c.s.d.HystrixDashboardProxyConnectionHandler - Proxying request
java.util.concurrent.TimeoutException: The timeout period of 5000ms has been exceeded
at io.vertx.core.http.impl.HttpClientRequestBase.timeout(HttpClientRequestBase.java:155)
at io.vertx.core.http.impl.HttpClientRequestBase.handleTimeout(HttpClientRequestBase.java:140)
at io.vertx.core.http.impl.HttpClientRequestBase.lambda$setTimeout$0(HttpClientRequestBase.java:100)
at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:782)
at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:753)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:316)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:440)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
at java.lang.Thread.run(Thread.java:745)
17:19:31.894 [vert.x-eventloop-thread-0] ERROR c.g.k.h.c.s.d.HystrixDashboardProxyConnectionHandler - Proxying request
io.vertx.core.VertxException: Connection was closed
at io.vertx.core.http.impl.ClientConnection.handleClosed(ClientConnection.java:396)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:314)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:190)
at io.vertx.core.net.impl.VertxHandler.channelInactive(VertxHandler.java:97)

最终尝试使curl localhost:8080 / hystrix.stream完全没有响应。

我不确定是否缺少任何人可以给我提示的信息?

问候。

最佳答案

我认为您在主类上缺少@HistrixDashBoard批注

关于java - Hystrix仪表板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47481273/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com