|
此版本仍在开发中,尚未视为稳定版。如需最新稳定版本,请使用 Spring Boot 4.0.4! |
应用程序启动(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: 898
{
"springBootVersion" : "4.0.5-SNAPSHOT",
"timeline" : {
"events" : [ {
"duration" : "PT0.000005671S",
"endTime" : "2026-03-19T18:21:52.605393810Z",
"startTime" : "2026-03-19T18:21:52.605388139Z",
"startupStep" : {
"id" : 3,
"name" : "spring.beans.instantiate",
"parentId" : 2,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ]
}
}, {
"duration" : "PT0.000019666S",
"endTime" : "2026-03-19T18:21:52.605398799Z",
"startTime" : "2026-03-19T18:21:52.605379133Z",
"startupStep" : {
"id" : 2,
"name" : "spring.boot.application.starting",
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ],
"startTime" : "2026-03-19T18:21:52.322111770Z"
}
}
清空应用程序启动步骤
要排空并返回应用程序启动阶段迄今为止记录的步骤,请向 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: 897
{
"springBootVersion" : "4.0.5-SNAPSHOT",
"timeline" : {
"events" : [ {
"duration" : "PT0.000210804S",
"endTime" : "2026-03-19T18:21:52.504042092Z",
"startTime" : "2026-03-19T18:21:52.503831288Z",
"startupStep" : {
"id" : 1,
"name" : "spring.beans.instantiate",
"parentId" : 0,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ]
}
}, {
"duration" : "PT0.00258802S",
"endTime" : "2026-03-19T18:21:52.504076286Z",
"startTime" : "2026-03-19T18:21:52.501488266Z",
"startupStep" : {
"id" : 0,
"name" : "spring.boot.application.starting",
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ],
"startTime" : "2026-03-19T18:21:52.322111770Z"
}
}
响应结构
响应包含应用程序启动步骤的详细信息。 下表描述了响应的结构:
| 路径 | 类型 | <description> </description> |
|---|---|---|
|
|
此应用程序的 Spring Boot 版本。 |
|
|
应用程序的启动时间。 |
|
|
到目前为止在应用程序启动期间收集的一组步骤。 |
|
|
此事件开始的时间戳。 |
|
|
此事件结束的时间戳。 |
|
|
此事件的确切持续时间。 |
|
|
StartupStep 的名称。 |
|
|
此 StartupStep 的 ID。 |
|
|
此 StartupStep 的父级 ID。 |
|
|
包含额外步骤信息的键值对数组。 |
|
|
StartupStep 标签的键。 |
|
|
StartupStep 标签的值。 |