我在Spring Boot应用程序中添加了以下依赖项:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
<version>2.1.3.RELEASE</version>
</dependency>
并用:标记配置类:
@EnableHystrixDashboard
@EnableHystrix
我尝试访问http://localhost:8080/hystrix
(我也尝试过http://localhost:8081/hystrix
)
我看到:
Whitelabel错误页面此应用程序没有针对 /错误,因此您将其视为备用。
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。
在调试中,我看到这些方法已被调用,但无论如何我都看到错误:
当我访问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,"50":24,"75":1019,"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","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,"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