006服务监控看板Hystrix Dashboard

天大地大妈咪最大 提交于 2020-03-07 00:50:56

1、POM配置

  和普通Spring Boot工程相比,仅仅添加了Hystrix Dashboard和Spring Boot Starter Actuator依赖

<dependencies>  <!--添加Turbine依赖-->
  <dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
  </dependency>
  <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
  </dependency>
</dependencies>
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-dependencies</artifactId>
      <version>Dalston.SR2</version>
      <type>pom</type>
      <scope>import</scope>
      </dependency>
  </dependencies>
</dependencyManagement>

02、使能Eureka Server

@SpringBootApplication
@EnableHystrixDashboard//使能HystrixDashboard
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

03、src/main/resources工程配置文件application.yml内容如下

spring:  application:    name: hystrix-dashboardserver:  port: 4010
04、使用方法
  a)浏览器访问http://localhost:4010/hystrix.dashboard
  b)Hystrix Dashboard下输入http://localhost:4001/turbine.stream,点击Monitor Stream即可看到监控面板
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!