spring-boot-starter-[actuator]

目录

引入依赖:

yml配置简短版: 

yml配置完整版:

pom.xml配置:(artifact: "@project.artifactId@" #从pom.xml中获取,使生效)


参考文章:

springboot学习27_coffeesunshine的博客-CSDN博客

spring-boot-starter-actuator的简单理解及应用_Mr_Punk的博客-CSDN博客

Springboot监控之一:SpringBoot四大神器之Actuator

actuator是spring boot提供的对应用系统的自省和监控的集成功能,可以对应用系统进行配置查看、相关功能统计等。 

引入依赖:

<!--boot健康监控-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

yml配置简短版: 

management:
  endpoint:
    health:
      enabled: true

yml配置完整版:

#health:http://localhost:54001/actuator/health http://localhost:8882/gatewayUrl/actuator/health
#info:http://localhost:54001/actuator/info http://localhost:8882/gatewayUrl/actuator/info
info:
  application: #此处的application可以随意指定
    artifact: "@project.artifactId@" #从pom.xml中获取
    name: "@project.name@"
    description: "@project.description@"
    version: "@project.version@"
management:
  server:
    port: 54001  # 指定监听端口,不指定则与server端口一致(此时需要加server的context-path:/gatewayUrl,并配置/actuator不拦截)
  endpoints:  # 启动所有监控点,默认情况下只有/info和/heath端点是启用的
    web:
      exposure:
        include: '*'
#  endpoint: # 启动指定监控点
#    shutdown:
#      enabled: true
#    health:
#      enabled: true
  info: # spring-boot 2.6以后info默认值为false.需手动开启
    env:
      enabled: true

pom.xml配置:(artifact: "@project.artifactId@" #从pom.xml中获取,使生效)

端点介绍:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值