SpringCloud视频教程:

https://ke.qq.com/course/2805647?tuin=a3e3fb1&from_uin=171851697&from=1000201007

个人博客纯净版

http://www.51ufo.cn/%E5%BE%AE%E6%9C%8D%E5%8A%A1/%E5%88%86%E5%B8%83%E5%BC%8F/2020/07/11/SpringCloud%E5%85%A5%E9%97%A824-Spring-Cloud-Gateway%E6%95%B4%E5%90%88actuator%E7%9B%91%E6%8E%A7.html

我们可以通过Spring Cloud Gateway整合actuator监控,查看网关的配置信息,下面我们来实现一下

首先在service-gateway服务pom.xml文件添加如下依赖:

<!--actuator 监控-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

然后在服务的application.yml文件中添加如下配置:

#开放所有页面节点  默认只开启了health、info两个节点
management:
  endpoints:
    web:
      exposure:
        include:  '*'

重启service-gateway服务,在浏览器访问http://localhost/actuator/gateway/routes,返回网关配置的路由信息,如下:

 

本文代码git地址 https://gitee.com/xmingtx/springcloud-lesson.git

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐