跳到主要内容
版本:4.0.2

应用启动(startup

QWen Max 中英对照 Application Startup (startup) Application Startup (startup)

startup 端点提供有关应用程序启动序列的信息。

获取应用程序启动步骤

应用程序启动步骤可以作为快照获取(GET),或从缓冲区中清空(POST)。

获取应用程序启动步骤的快照

要检索应用程序启动阶段至今记录的步骤,请向 /actuator/startup 发起 GET 请求,如下列基于 curl 的示例所示:

$ curl 'http://localhost:8080/actuator/startup' -i -X GET

得到的响应类似于以下内容:

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 888

{
"springBootVersion" : "4.0.2",
"timeline" : {
"events" : [ {
"duration" : "PT0.000006231S",
"endTime" : "2026-01-22T12:43:53.719192075Z",
"startTime" : "2026-01-22T12:43:53.719185844Z",
"startupStep" : {
"id" : 3,
"name" : "spring.beans.instantiate",
"parentId" : 2,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ]
}
}, {
"duration" : "PT0.00002129S",
"endTime" : "2026-01-22T12:43:53.719197225Z",
"startTime" : "2026-01-22T12:43:53.719175935Z",
"startupStep" : {
"id" : 2,
"name" : "spring.boot.application.starting",
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ],
"startTime" : "2026-01-22T12:43:53.420838676Z"
}
}

排空应用启动步骤

要排空并返回应用程序启动阶段迄今为止记录的步骤,请向 /actuator/startup 发送 POST 请求,如下列基于 curl 的示例所示:

$ curl 'http://localhost:8080/actuator/startup' -i -X POST

得到的响应类似于以下内容:

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 889

{
"springBootVersion" : "4.0.2",
"timeline" : {
"events" : [ {
"duration" : "PT0.000258531S",
"endTime" : "2026-01-22T12:43:53.610992209Z",
"startTime" : "2026-01-22T12:43:53.610733678Z",
"startupStep" : {
"id" : 1,
"name" : "spring.beans.instantiate",
"parentId" : 0,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ]
}
}, {
"duration" : "PT0.018369187S",
"endTime" : "2026-01-22T12:43:53.618077350Z",
"startTime" : "2026-01-22T12:43:53.599708163Z",
"startupStep" : {
"id" : 0,
"name" : "spring.boot.application.starting",
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ],
"startTime" : "2026-01-22T12:43:53.420838676Z"
}
}

响应结构

响应包含应用程序启动步骤的详细信息。下表描述了响应的结构:

路径类型描述
springBootVersionString此应用的 Spring Boot 版本。
timeline.startTimeString应用的启动时间。
timeline.eventsArray应用启动至今收集到的步骤数组。
timeline.events.[].startTimeString此事件的开始时间戳。
timeline.events.[].endTimeString此事件的结束时间戳。
timeline.events.[].durationString此事件的精确持续时间。
timeline.events.[].startupStep.nameStringStartupStep 的名称。
timeline.events.[].startupStep.idNumber此 StartupStep 的 ID。
timeline.events.[].startupStep.parentIdNumber此 StartupStep 的父 ID。
timeline.events.[].startupStep.tagsArray包含额外步骤信息的键值对数组。
timeline.events.[].startupStep.tags[].keyStringStartupStep 标签的键。
timeline.events.[].startupStep.tags[].valueStringStartupStep 标签的值。