actuator--基础--02--endpoints

actuator–基础–02–endpoints


1、介绍

  1. Spring Boot 提供了所谓的 endpoints (端点)给外部,来访问应用程序。
    1. 举例:
      1. /health 端点 提供了关于应用健康情况的一些基础信息。
      2. metrics 端点 提供了一些有用的应用程序指标(JVM 内存使用、系统CPU使用等)。
  2. 原生端点
    1. Actuator 模块本来就有的端点称为原生端点

1.1、Actuator 模块分为三大类

1.1.1、应用配置类

获取应用程序中加载的应用配置、环境变量、自动化配置报告等与Spring Boot应用密切相关的配置类信息。

1.1.2、度量指标类

获取应用程序运行过程中用于监控的度量指标,比如:内存信息、线程池信息、HTTP请求统计等。

1.1.3、操作控制类

提供了对应用的关闭等操作类功能。

1.2、注意

  1. 每一个端点都可以通过配置来单独禁用或者启动
  2. Actuator 2.x 中的默认端点 增加了 /actuator前缀。
  3. Actuator 2.x 默认暴露的两个端点
    1. /actuator/health
    2. /actuator/info
  4. Actuator 2.x 除了默认暴露的两个端点,其余端点默认被禁掉。

2、Actuator 提供的所有endpoint

2.1、/actuator

  1. HTTP方法:GET
  2. 查看有哪些 Actuator endpoint 是开放的

在这里插入图片描述

2.2、/actuator/auditevent

  1. HTTP方法:GET
  2. 查看 audit 的事件,例如认证进入、订单失败,需要搭配 Spring security 使用

2.3、/actuator/beans

  1. HTTP方法:GET
  2. 查看运行当下里面全部的 bean,以及他们的关係

在这里插入图片描述

2.4、/actuator/conditions

  1. HTTP方法:GET
  2. 查看自动配置的結果,记录哪些自动配置条件通过了,哪些沒通过

在这里插入图片描述

2.5、/actuator/configprops

  1. HTTP方法:GET
  2. 查看注入带有 @ConfigurationProperties 类的 properties 值为何(包含默认值)

在这里插入图片描述

2.6、/actuator/env(常用)

  1. HTTP方法:GET
  2. 查看全部环境属性
    1. 可以看到 SpringBoot 载入了哪些 properties,以及这些 properties 的值
    2. 但是会自动*掉带有 key、password、secret 等关键字的 properties 的值,保护信息安全

在这里插入图片描述

2.7、/actuator/flyway

  1. HTTP方法:GET
  2. 查看 flyway DB 的 migration 信息

2.8、/actuator/health (常用)

  1. HTTP方法:GET
  2. 查看当前 SpringBoot 运行的健康指标,值由 HealthIndicator 的实现类提供(所以可以自定义一些健康指标资讯,加到这里面)

在这里插入图片描述

2.9、/actuator/heapdump

  1. HTTP方法:GET
  2. 取得 JVM 当下的 heap dump,会下载一个文档
    在这里插入图片描述

2.10、/actuator/info

  1. HTTP方法:GET
  2. 查看 properties 中 info 开头的属性的值,没什么用

在这里插入图片描述

2.11、/actuator/mappings

  1. HTTP方法:GET
  2. 查看全部的 endpoint(包含 Actuator 的),以及他们和 Controller 的关係

在这里插入图片描述

2.12、/actuator/metrics(常用)

  1. HTTP方法:GET
  2. 查看有哪些指标可以看
    1. 举例:
      1. jvm.memory.max
      2. system.cpu.usage)
    2. 要使用/actuator/metrics/{metric.name}分別查看各指标的详细信息

在这里插入图片描述

2.13、/actuator/scheduledtasks

  1. HTTP方法:GET
  2. 查看定时任务的信息

在这里插入图片描述

2.14、/actuator/shutdown

  1. HTTP方法:POST
  2. 唯一一个需要 POST 請求的 endpoint,关闭这个 Springboot

2.15、/actuator/caches

  1. HTTP方法:GET
  2. 暴露可用的缓存。

在这里插入图片描述

2.16、/actuator/loggers

  1. HTTP方法:GET
  2. 显示和修改应用程序中日志的配置。。

在这里插入图片描述

2.17、/actuator/threaddump

  1. HTTP方法:GET
  2. 执行线程转储。

在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值