1

I am making an application using Spring Boot 2.3.12, Java 11 and Spring Cloud Hoxton.SR11. I added Eureka and Hystrix services. When I call 'http://localhost:8080/actuator/hystrix.stream' I get a stream of messages like data: {"type": "ping"}.

But when I insert this path into 'http://localhost:9195/hystrix/' I get an error message 'Unable to connect to Command Metric Stream.' and WARN-log 'Origin parameter: http://localhost:8080/actuator/hystrix.stream is not in the allowed list of proxy host names. If it should be allowed add it to hystrix.dashboard.proxyStreamAllowList'.

I added this to gateway properties.yaml:

management:
  endpoints:
    web:
      exposure:
        include: hystrix.stream, info, health

hystrix:
  dashboard:
    proxy-stream-allow-list: "*"
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 10000

EUREKA

HYSTRIX

Additional info:

  1. I added spring-boot-starter-actuator to pom.xml of gateway-service. I also added spring-cloud-starter-circuitbreaker-reactor-resilience4j.
  2. IntelliJ IDEA marked proxy-stream-allow-list and timeoutInMilliseconds as 'Cannot resolve configuration property'
  3. These links didn't help: Unable to connect to Command Metric Stream in hystrix dashboard, Unable to connect to Command Metric Stream for Hystrix Dashboard with Spring Cloud, Hystrix: Unable to connect to Command Metric Stream, Hystrix Dashboard Issue in Spring Boot, Unable to connect to Command Metric Stream. in Hystrix Dashboard issue.

UPDATE 1: unresolved dependency

UPDATE 2:

I use Hystrix Dashboard as separate new Java module. This module contains application.properties:

server.port=9195

And main class:

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;

@SpringBootApplication
@EnableHystrixDashboard
public class HystrixDashboardApplication {

    public static void main(String[] args) {
        SpringApplication.run(HystrixDashboardApplication.class, args);
    }

}
Mykola
  • 121
  • 2
  • 11
  • That works in my test. What project has the hystrix dashboard dependency? Idea will never resolve most hystrix.* properties. Can you check the value of `hystrix.dashboard.proxy-stream-allow-list` in /actuator/configprops? – spencergibb Jul 01 '21 at 16:45
  • @spencergibb, I added configprops to `management.endpoints.web.exposure.include` and opened the webpage on url http://localhost:8080/actuator/configprops, but I do not see `proxy-stream-allow-list` field. Please, check update screen in Q. – Mykola Jul 02 '21 at 11:35
  • Then the problem is it isn't configured correctly. You never answered which project has the dashboard dependency. – spencergibb Jul 06 '21 at 22:43
  • @spencergibb I create new module for dashboard called hystrix-dashboard. – Mykola Jul 13 '21 at 13:57
  • And what does that projects application.yml look like? – spencergibb Jul 14 '21 at 14:20
  • Module 'hystrix-dashboard' has only server.port property in application.properties. It starts on port 9195. I updated a question. – Mykola Jul 15 '21 at 07:55
  • Put `hystrix.dashboard.proxy-stream-allow-list` configuration in that project – spencergibb Jul 15 '21 at 22:26

1 Answers1

0

modfiy application.yml

  management:
    endpoints:
        web:
          exposure:
            include: hystrix.stream
      endpoint:
        hystrix:
          stream:
            enabled: true
    hystrix:
      dashboard:
        proxy-stream-allow-list: 127.0.0.1,1xx.xxx.xxx.xxx
Gastón Schabas
  • 2,153
  • 1
  • 10
  • 17
aiyi-rain
  • 1
  • 1