需要导入actuator依赖:
<!-- 监控中心 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
然后在application.properties里添加如下配置,避免用户访问部分监控地址时访问受限
management:
security:
enabled: false
然后我们可以用/actuator来查看各种信息(监控,健康等),比如localhost:8080/actuator