|
此版本仍在开发中,尚未被视为稳定版本。如需最新稳定版本,请使用 Spring Boot 4.0.4! |
应用启动(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: 898
{
"springBootVersion" : "4.1.0-SNAPSHOT",
"timeline" : {
"events" : [ {
"duration" : "PT0.000005581S",
"endTime" : "2026-03-19T22:23:58.181830425Z",
"startTime" : "2026-03-19T22:23:58.181824844Z",
"startupStep" : {
"id" : 3,
"name" : "spring.beans.instantiate",
"parentId" : 2,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ]
}
}, {
"duration" : "PT0.000025437S",
"endTime" : "2026-03-19T22:23:58.181842687Z",
"startTime" : "2026-03-19T22:23:58.181817250Z",
"startupStep" : {
"id" : 2,
"name" : "spring.boot.application.starting",
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ],
"startTime" : "2026-03-19T22:23:58.021335106Z"
}
}
耗尽应用程序启动步骤
要清空并返回应用程序启动阶段迄今记录的所有步骤,请向 /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: 898
{
"springBootVersion" : "4.1.0-SNAPSHOT",
"timeline" : {
"events" : [ {
"duration" : "PT0.000238637S",
"endTime" : "2026-03-19T22:23:58.117525740Z",
"startTime" : "2026-03-19T22:23:58.117287103Z",
"startupStep" : {
"id" : 1,
"name" : "spring.beans.instantiate",
"parentId" : 0,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ]
}
}, {
"duration" : "PT0.001204414S",
"endTime" : "2026-03-19T22:23:58.117552390Z",
"startTime" : "2026-03-19T22:23:58.116347976Z",
"startupStep" : {
"id" : 0,
"name" : "spring.boot.application.starting",
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ],
"startTime" : "2026-03-19T22:23:58.021335106Z"
}
}
响应结构
响应包含应用程序启动步骤的详细信息。 以下表格描述了响应的结构:
| 路径 | 类型 | 描述 |
|---|---|---|
|
|
此应用程序的 Spring Boot 版本。 |
|
|
应用程序的启动时间。 |
|
|
截至目前应用启动过程中收集的步骤数组。 |
|
|
此事件开始的时间戳。 |
|
|
此事件结束的时间戳。 |
|
|
此事件的确切持续时间。 |
|
|
StartupStep 的名称。 |
|
|
此 StartupStep 的 id。 |
|
|
此 StartupStep 的父 ID。 |
|
|
包含额外步骤信息的键/值对数组。 |
|
|
StartupStep 标签的键。 |
|
|
StartupStep 标签的值。 |