如何访问hystrix仪表板?

问题描述 投票:1回答:1

我在Spring Boot应用程序中添加了以下依赖项:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
    <version>2.1.3.RELEASE</version>
</dependency>

并用:标记配置类>

@EnableHystrixDashboard

我尝试访问http://localhost:8080/hystrix(我也尝试了http://localhost:8081/hystrix

我看到:

Whitelabel错误页面此应用程序没有针对/ error,因此您将其视为备用。

[Mon Nov 11 21:47:56 MSK 2019发生意外错误(type = Not找到,状态为404)。无可用消息

在启动过程中,我看到以下消息:

2019-11-11 21:43:17.724  INFO 15912 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-11-11 21:43:22.581  INFO 15912 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2019-11-11 21:43:23.362  INFO 15912 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8081 (http)
2019-11-11 21:43:23.507  INFO 15912 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8081 (http) with context path ''

如何访问hystrix仪表板?

P.S。

在调试中,我看到这些方法被调用,但是无论如何我都看到错误:

enter image description here

当我访问URL时也看到以下响应:http://localhost:8080/actuator/hystrix.stream

data: {"type":"HystrixCommand","name":"executeHttpCall","group":"MyAPIConnectorImpl","currentTime":1573503001364,"isCircuitBreakerOpen":false,"errorPercentage":0,"errorCount":0,"requestCount":0,"rollingCountBadRequests":0,"rollingCountCollapsedRequests":0,"rollingCountEmit":0,"rollingCountExceptionsThrown":0,"rollingCountFailure":0,"rollingCountFallbackEmit":0,"rollingCountFallbackFailure":0,"rollingCountFallbackMissing":0,"rollingCountFallbackRejection":0,"rollingCountFallbackSuccess":0,"rollingCountResponsesFromCache":0,"rollingCountSemaphoreRejected":0,"rollingCountShortCircuited":0,"rollingCountSuccess":0,"rollingCountThreadPoolRejected":0,"rollingCountTimeout":0,"currentConcurrentExecutionCount":0,"rollingMaxConcurrentExecutionCount":0,"latencyExecute_mean":948,"latencyExecute":{"0":16,"25":18,"50":23,"75":1008,"90":3767,"95":3767,"99":3767,"99.5":3767,"100":3767},"latencyTotal_mean":950,"latencyTotal":{"0":16,"25":18,"50":24,"75":1019,"90":3767,"95":3767,"99":3767,"99.5":3767,"100":3767},"propertyValue_circuitBreakerRequestVolumeThreshold":20,"propertyValue_circuitBreakerSleepWindowInMilliseconds":5000,"propertyValue_circuitBreakerErrorThresholdPercentage":50,"propertyValue_circuitBreakerForceOpen":false,"propertyValue_circuitBreakerForceClosed":false,"propertyValue_circuitBreakerEnabled":true,"propertyValue_executionIsolationStrategy":"THREAD","propertyValue_executionIsolationThreadTimeoutInMilliseconds":1000,"propertyValue_executionTimeoutInMilliseconds":1000,"propertyValue_executionIsolationThreadInterruptOnTimeout":true,"propertyValue_executionIsolationThreadPoolKeyOverride":null,"propertyValue_executionIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_metricsRollingStatisticalWindowInMilliseconds":10000,"propertyValue_requestCacheEnabled":true,"propertyValue_requestLogEnabled":true,"reportingHosts":1,"threadPool":"MyAPIConnectorImpl"}

data: {"type":"HystrixThreadPool","name":"MyAPIConnectorImpl","currentTime":1573503001364,"currentActiveCount":0,"currentCompletedTaskCount":18,"currentCorePoolSize":10,"currentLargestPoolSize":10,"currentMaximumPoolSize":10,"currentPoolSize":10,"currentQueueSize":0,"currentTaskCount":18,"rollingCountThreadsExecuted":0,"rollingMaxActiveThreads":0,"rollingCountCommandRejections":0,"propertyValue_queueSizeRejectionThreshold":5,"propertyValue_metricsRollingStatisticalWindowInMilliseconds":10000,"reportingHosts":1}

ping:

在调试日志中,我看到:

2019-11-11 23:41:28.436 DEBUG 6604 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : GET "/hystrix/index", parameters={}
2019-11-11 23:41:28.447 DEBUG 6604 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.cloud.netflix.hystrix.dashboard.HystrixDashboardController#monitor(String, Model, WebRequest)
2019-11-11 23:41:28.480 DEBUG 6604 --- [nio-8080-exec-1] o.s.ui.freemarker.SpringTemplateLoader   : Looking for FreeMarker template with name [hystrix/index_ru_RU.ftlh]
2019-11-11 23:41:28.482 DEBUG 6604 --- [nio-8080-exec-1] o.s.ui.freemarker.SpringTemplateLoader   : Looking for FreeMarker template with name [hystrix/index_ru.ftlh]
2019-11-11 23:41:28.482 DEBUG 6604 --- [nio-8080-exec-1] o.s.ui.freemarker.SpringTemplateLoader   : Looking for FreeMarker template with name [hystrix/index.ftlh]
2019-11-11 23:41:28.485 DEBUG 6604 --- [nio-8080-exec-1] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, application/xhtml+xml, image/webp, image/apng, application/signed-exchange;v=b3, application/xml;q=0.9, */*;q=0.8]
2019-11-11 23:41:28.485 DEBUG 6604 --- [nio-8080-exec-1] o.s.w.servlet.view.InternalResourceView  : View name 'hystrix/index', model {basePath=/hystrix/index, contextPath=}
2019-11-11 23:41:28.487 DEBUG 6604 --- [nio-8080-exec-1] o.s.w.servlet.view.InternalResourceView  : Forwarding to [hystrix/index]
2019-11-11 23:41:28.491 DEBUG 6604 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : "FORWARD" dispatch for GET "/hystrix/hystrix/index", parameters={}
2019-11-11 23:41:28.494 DEBUG 6604 --- [nio-8080-exec-1] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]
2019-11-11 23:41:28.497 DEBUG 6604 --- [nio-8080-exec-1] o.s.w.s.r.ResourceHttpRequestHandler     : Resource not found
2019-11-11 23:41:28.498 DEBUG 6604 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Exiting from "FORWARD" dispatch, status 404
2019-11-11 23:41:28.499 DEBUG 6604 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed 404 NOT_FOUND
2019-11-11 23:41:28.502 DEBUG 6604 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : "ERROR" dispatch for GET "/error", parameters={}
2019-11-11 23:41:28.503 DEBUG 6604 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse)
2019-11-11 23:41:28.513 DEBUG 6604 --- [nio-8080-exec-1] o.s.ui.freemarker.SpringTemplateLoader   : Looking for FreeMarker template with name [error_ru_RU.ftlh]
2019-11-11 23:41:28.514 DEBUG 6604 --- [nio-8080-exec-1] o.s.ui.freemarker.SpringTemplateLoader   : Looking for FreeMarker template with name [error_ru.ftlh]
2019-11-11 23:41:28.514 DEBUG 6604 --- [nio-8080-exec-1] o.s.ui.freemarker.SpringTemplateLoader   : Looking for FreeMarker template with name [error.ftlh]
2019-11-11 23:41:28.515 DEBUG 6604 --- [nio-8080-exec-1] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, text/html;q=0.8]
2019-11-11 23:41:28.519 DEBUG 6604 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Exiting from "ERROR" dispatch, status 404

我在Spring Boot应用程序中添加了以下依赖项:org.springframework.cloud

java spring-boot spring-cloud spring-cloud-netflix hystrix
1个回答
0
投票

Hystrix搜索@HystrixCommand批注,以显示有关您要监视的服务的数据,并且它需要执行器端点。您将需要这两个依赖项:

© www.soinside.com 2019 - 2024. All rights reserved.