应用程序启动(startup)
startup 端点提供有关应用程序启动顺序的信息。
检索应用程序启动步骤
应用程序的启动步骤可以以快照形式获取(GET),也可以从缓冲区中清空读取(POST)。
检索应用程序启动步骤的快照
要获取应用程序启动阶段迄今为止记录的步骤,请向 GET 发送一个 /actuator/startup 请求,如下列基于 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: 889
{
"springBootVersion" : "4.0.4",
"timeline" : {
"events" : [ {
"duration" : "PT0.000006381S",
"endTime" : "2026-03-19T11:11:12.282535788Z",
"startTime" : "2026-03-19T11:11:12.282529407Z",
"startupStep" : {
"id" : 3,
"name" : "spring.beans.instantiate",
"parentId" : 2,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ]
}
}, {
"duration" : "PT0.000020368S",
"endTime" : "2026-03-19T11:11:12.282541339Z",
"startTime" : "2026-03-19T11:11:12.282520971Z",
"startupStep" : {
"id" : 2,
"name" : "spring.boot.application.starting",
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ],
"startTime" : "2026-03-19T11:11:12.133232977Z"
}
}
清空应用程序启动步骤
要排空并返回应用程序启动阶段迄今为止记录的步骤,请向 POST 发送一个 /actuator/startup 请求,如下列基于 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: 888
{
"springBootVersion" : "4.0.4",
"timeline" : {
"events" : [ {
"duration" : "PT0.000259182S",
"endTime" : "2026-03-19T11:11:12.223211231Z",
"startTime" : "2026-03-19T11:11:12.222952049Z",
"startupStep" : {
"id" : 1,
"name" : "spring.beans.instantiate",
"parentId" : 0,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ]
}
}, {
"duration" : "PT0.00429563S",
"endTime" : "2026-03-19T11:11:12.223240436Z",
"startTime" : "2026-03-19T11:11:12.218944806Z",
"startupStep" : {
"id" : 0,
"name" : "spring.boot.application.starting",
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ],
"startTime" : "2026-03-19T11:11:12.133232977Z"
}
}
响应结构
响应包含应用程序启动步骤的详细信息。 下表描述了响应的结构:
| 路径 | 类型 | <description> </description> |
|---|---|---|
|
|
此应用程序的 Spring Boot 版本。 |
|
|
应用程序的启动时间。 |
|
|
到目前为止在应用程序启动期间收集的一组步骤。 |
|
|
此事件开始的时间戳。 |
|
|
此事件结束的时间戳。 |
|
|
此事件的确切持续时间。 |
|
|
StartupStep 的名称。 |
|
|
此 StartupStep 的 ID。 |
|
|
此 StartupStep 的父级 ID。 |
|
|
包含额外步骤信息的键值对数组。 |
|
|
StartupStep 标签的键。 |
|
|
StartupStep 标签的值。 |