什么是actuator?
Actuator 是 Spring Boot 提供的对应用系统的自省和监控的集成功能,可以查看应用配置的详细信息,例如自动化配置信息、创建的 Spring beans 以及一些环境属性等
如何接入
SpringBoot版本
2.2.2.RELEASE
接入
1.接入actuator只需要添加 actuator依赖即可
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
2.在配置文件中新增内容
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: always
shutdown:
enabled: true
验证
启动程序后,输入 ip:port/actuator 即可查看数据