码迷,mamicode.com
首页 > 编程语言 > 详细

SpringCloud------断路器Dashboard监控仪表盘

时间:2020-03-14 14:28:38      阅读:79      评论:0      收藏:0      [点我收藏+]

标签:adb   import   int   span   exp   width   art   pid   points   

1.添加依赖

<!-- 仪表盘监控 -->
<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

 

2.添加启动类注解@EnableHystrixDashboard

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication
@MapperScan("cn.ytheng.order_service")
@EnableFeignClients
@EnableCircuitBreaker
@EnableHystrixDashboard
public class OrderServiceApplication {


    public static void main(String[] args) {

        SpringApplication.run(OrderServiceApplication.class, args);
    }

}

 

3.修改application.yml配置


server:
port: 8781

#暴露全部的监控信息 management: endpoints: web: exposure: include:
"*"

 

4.访问地址

http://localhost:8781/hystrix

http://localhost:8781/actuator/hystrix.stream

技术图片

 

SpringCloud------断路器Dashboard监控仪表盘

标签:adb   import   int   span   exp   width   art   pid   points   

原文地址:https://www.cnblogs.com/tianhengblogs/p/12491845.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!