首页 > 编程语言 > 详细

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

时间:2020-03-14 14:43:58      阅读:92      评论:0      收藏:0      [点我收藏+]

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监控仪表盘

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!