在项目中添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
然后需要在配置文件中添加配置
management.endpoints.web.exposure.include=*
不加的话可以访问几个默认的,比如health等等
然后访问端口号并加上/actuator才能访问相应的端点
比如 程序 的端口号为2201 现在想看/beans 的监控
访问地址为127.0.0.1:2201/actuator/beans 才可以,以此类推