SpringBoot监控

一、使用Actuator检查与监控

1,在pom中添加Actuator的坐标。

2,在全局配置文件中设置关闭安全限制。

3,请求路径关键字

二、使用可视化监控报表-SpringBootAdmin

1,搭建服务端

  服务端其实也是一个SpringBoot项目

添加pom依赖

1 <dependency>
2     <groupId>de.codecentric</groupId>
3     <artifactId>spring-boot-admin-starter-server</artifactId>
4     <version>1.5.7</version>
5 </dependency>

修改启动类

1 @SpringBootApplication
2 @EnableAdminServer
3 public class SpringBootServerApplication {
4     public static void main(String[] args) {
5         SpringApplication.run(SpringBootServerApplication.class, args);
6     }
7 }

2,搭建客户端

  客户端其实就是我们要监控的工程

修改客户端pom依赖

1 <dependency>
2     <groupId>de.codecentric</groupId>
3     <artifictId>spring-boot-admin-starter-client</artifactId>
4     <version>1.5.7</version>
5 </dependency>

修改客户端的application.properties配置文件

1 management.security.enabled=false
2 spring.boot.admin.url: http://127.0.0.1:9000 
原文地址:https://www.cnblogs.com/guanghe/p/11014722.html