dyc87112/SpringCloud-Learning

Hystrix监控面板无法正常使用的问题【已解决】

c-rainstorm opened this issue · 0 comments

版本信息

Spring Boot: 2.2.0.RELEASE
Spring Cloud : Hoxton.RC1
actuator : 2.2.0.RELEASE
hystrix : spring-cloud-starter-netflix-hystrix

解决方案

server.port=${PORT}
management.server.port=${MPORT}

management.endpoints.web.exposure.include=*

两个端口取不同值

源码位置

org.springframework.boot.actuate.autoconfigure.endpoint.web.servlet.WebMvcEndpointManagementContextConfiguration#webEndpointServletHandlerMapping

image

不同值时 shouldRegisterLinksMapping 变量才会 true,对扫描到的 HystrixStreamEndpoint 进行注册