一、Spring Boot Admin简介
spring boot admin github开源地址:https://github.com/codecentric/spring-boot-admin
它主要的作用是在Spring Boot Actuator的基础上提供简洁的WEB UI展示。
二、项目使用:
1、搭建一个maven web项目
2、pom依赖配置
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-client</artifactId> </dependency> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-server</artifactId> </dependency> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-server-ui</artifactId> </dependency> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-server-ui-login</artifactId> </dependency>在pom.xml中添加上以上配置
admin服务端:spring-boot-admin-server、spring-boot-admin-server-ui
admin客户端:spring-boot-admin-starter-client (加上该项能监控服务端自身的运行状态,其他项目只需要引入client就可以引入监控)
安全:spring-boot-starter-security
登录验证:spring-boot-admin-server-ui-login (也可以自行添加简单的登录界面)
3、application.yml
info: app: name: imard version: v1.0.0 [html] view plain copylogging: file: "d:/logs/imard/boot.log" management: context-path: "/actuator" spring: application: name: "@pom.artifactId@" boot: admin: url: http://:8080/login.html监控登录界面进行安全验证后,如下图:进入details就可以看到具体的项目监控信息(Details、Log、Metrics、Environment、Logging、JMX、Threads、Audit、Trace、Heapdump)
总结
以上所述是小编给大家介绍的spring boot 添加admin监控的方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!