Spring Boot Endpoints:端点

Spring Boot 内置端点以及暴露端点列表:

端点被启用后,并不一定能够被访问,还要看端点是否被暴露,并且暴露的方式是怎样的。因为端点可能会包含敏感信息,所以需要谨慎暴露相关端点。Spring Boot 3.0.0 更改了默认暴露的端点,默认以 JMX 和 Web 方式只暴露了 Health 一个端点。

端点 ID 功能 端点 ID JMX Web
auditevents 暴露当前应用程序的审计事件信息 auditevents Yes No
beans 显示应用程序中的所有 Spring Bean beans Yes No
caches 暴露可用的缓存 caches Yes No
conditions 显示配置类上评估条件及匹配成功与否的原因 conditions Yes No
configprops 显示所有的 @ConfigurationProperties 列表 configprops Yes No
env 从 Spring 环境中暴露所有 properties env Yes No
flyway 显示所有 Flyway 迁移记录 flyway Yes No
health 显示健康信息 health Yes Yes
httpexchanges 显示 HTTP 交换信息(默认显示最后 100 个) httptrace Yes No
info 显示应用程序基本信息 info Yes No
integrationgraph 显示 Spring Integration 图表 integrationgraph Yes No
loggers 显示或者修改日志配置 loggers Yes No
liquibase 显示所有 liquibase 迁移记录 liquibase Yes No
metrics 显示指标信息 metrics Yes No
mappings 显示所有 @RequestMapping 映射路径 mappings Yes No
quartz 显示 Quartz 任务调度信息 quartz Yes No
scheduledtasks 显示所有的任务调度 scheduledtasks Yes No
sessions 从 Spring Session 中检索和删除用户会话 sessions Yes No
shutdown 优雅关闭应用程序 shutdown Yes No
startup 显示应用程序启动步骤数据 startup Yes No
threaddump 执行线程 dump threaddump Yes No

端点暴露yml配置

复制代码
management:
  endpoints:
    jmx:
      exposure:
        #以JMX 方式只暴露 health 和 info 端点
        include: health,info
    web:
      exposure:
        #以 Web 方式暴露的端点
        include: "*"
        #停止以 Web 方式暴露的threaddump端点
        exclude: threaddump
相关推荐
七夜zippoe21 小时前
API网关设计模式实战 Spring Cloud Gateway路由过滤限流深度解析
java·设计模式·gateway·路由·api网关
咖啡啡不加糖21 小时前
Arthas 使用指南:Java 应用诊断利器
java·spring boot·后端
大佐不会说日语~21 小时前
Docker Compose 部署 Spring Boot 应用 502 Bad Gateway 问题排查与解决
spring boot·docker·gateway·maven·故障排查
J_liaty21 小时前
SpringBoot整合Canal实现数据库实时同步
数据库·spring boot·后端·canal
lead520lyq21 小时前
Golang Grpc接口调用实现账号密码认证
开发语言·后端·golang
小北方城市网1 天前
MongoDB 分布式存储与查询优化:从副本集到分片集群
java·spring boot·redis·分布式·wpf
想逃离铁厂的老铁1 天前
Day60 >> 94、城市间货物运输1️⃣ + 95、城市间货物运输 2️⃣ + 96、城市间货物运输 3️⃣
java·服务器·前端
JaguarJack1 天前
Laravel AI SDK 在 Laracon India 2026 首次亮相
后端·php·laravel
kyrie学java1 天前
SpringWeb
java·开发语言
TTBIGDATA1 天前
【Hue】Ambari 页面启动 Hue 失败 user ‘hadoop‘ does not exist
java·hadoop·ambari