springboot2.0 Hystrix Unable to connect to Command Metric Stream

springboot2.0 Hystrix  Unable to connect to Command Metric Stream

pom.xml

 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.1.RELEASE</version>
        <relativePath/>
    </parent>

  <dependencies>

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

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        
        其餘省略

    </dependencies>

啓動類添加註解

@SpringBootApplication
@EnableHystrixDashboard
@EnableCircuitBreaker

配置文件 application.yml 添加

management:
  endpoints:
    web:
      exposure:
        include: ["health","info","hystrix.stream"]
      base-path: /

http://hystrix-app:port/hystrix.stream 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章