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
相关推荐
朝阳5812 分钟前
Rust项目GPG签名配置指南
开发语言·后端·rust
微网兔子2 分钟前
伺服器用什么语言开发呢?做什么用什么?
服务器·c++·后端·游戏
朝阳5814 分钟前
Rust实现高性能目录扫描工具ll的技术解析
开发语言·后端·rust
zhang238390615411 分钟前
IDEA add gitlab account 提示
java·gitlab·intellij-idea·idea
橘猫云计算机设计14 分钟前
springboot基于hadoop的酷狗音乐爬虫大数据分析可视化系统(源码+lw+部署文档+讲解),源码可白嫖!
数据库·hadoop·spring boot·爬虫·python·数据分析·毕业设计
小希爸爸26 分钟前
2、中医基础入门和养生
前端·后端
牛马baby29 分钟前
Java高频面试之并发编程-07
java·开发语言·面试
卓怡学长1 小时前
w304基于HTML5的民谣网站的设计与实现
java·前端·数据库·spring boot·spring·html5
YONG823_API1 小时前
深度探究获取淘宝商品数据的途径|API接口|批量自动化采集商品数据
java·前端·自动化
yzhSWJ1 小时前
Spring Boot中自定义404异常处理问题学习笔记
java·javascript