玩转springboot之springboot项目监测

2024-07-06  本文已影响0人  墨线宝

项目监测

springboot中提供了actuator项目来进行监测和度量

基于springboot2.x版本

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

actuator中提供了多个端点来对springboot项目进行监测

可以访问http://{ip}:{port}/actuator/{endpoint} 端点来进行访问

如果想要暴露所有的端点,则需要配置暴露所有

management:
  endpoints:
    web:   #使用http访问端点暴露,默认根路径是actuator,可以使用base-path来配置
      exposure:
        include: '*'  #暴露所有端点
        exclude: env,mappings  #排除某些端点

https://zhhll.icu/2021/框架/springboot/基础/13.项目监测/

本文由mdnice多平台发布

上一篇下一篇

猜你喜欢

热点阅读