玩转springboot之springboot项目监测

项目监测

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

基于springboot2.x版本

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

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

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

  • actuator/archaius
  • actuator/beans 列出应用中的所有bean
  • actuator/caches
  • actuator/caches/{cache}
  • actuator/health 应用健康检查,实现了HealthIndicator,有UP、DOWN、OUTOFSERVICE、UNKNOWN,如果需要查看详情,需要配置 management.endpoint.health.show-details
  • actuator/health/{*path}
  • actuator/info 列出应用信息,在配置中以info开头的配置,实现了InfoContributor接口的配置类
  • actuator/conditions 显示自动配置信息
  • actuator/configprops 显示所有@ConfigurationProperties的配置属性列表
  • actuator/env 列出应用中的配置
  • actuator/env/{toMatch}
  • actuator/loggers/{name}
  • actuator/loggers
  • actuator/heapdump 堆快照
  • actuator/threaddump 线程快照
  • actuator/metrics/{requiredMetricName}
  • actuator/metrics 显示应用度量标准信息
  • actuator/scheduledtasks 列出应用中的定时任务
  • actuator/mappings 列出所有的地址映射
  • actuator/refresh
  • actuator/features
  • actuator/service-registry

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

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

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

本文由mdnice多平台发布

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

拾光师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值