spring boot Actuator监控

参考:Spring Boot Actuator:健康检查、审计、统计和监控 - 简书 (jianshu.com)

加入起步依赖

        <!--actuator起步依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        

然后启动项目

打开url:http://localhost:8080/actuator/

就可以看到一些信息了

我们还可以进行一些配置,application.yml

management:
  endpoint:
    health:
      enabled: true
      show-details: always #总是显示
  endpoints:
    web:
      exposure:
        include: "*"  #开放所有端点(生产环境不安全)
info:
  age: 18
  name: zhangsan

--------------------

如果我们直接看json格式的数据有点费劲,我们可以使用springBoot Admin

posted @ 2021-09-01 01:28  在线电影制作人  阅读(5)  评论(0)    收藏  举报  来源