此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Boot 3.3.1! |
此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Boot 3.3.1! |
终结点提供有关应用程序启动序列的信息。startup
检索应用程序启动步骤
应用程序启动步骤可以作为快照 () 检索,也可以从缓冲区 () 中排出。GET
POST
检索应用程序启动步骤的快照
若要检索到目前为止在应用程序启动阶段记录的步骤,请向 发出请求,如以下基于 curl 的示例所示:GET
/actuator/startup
$ 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" : "3.3.2-SNAPSHOT",
"timeline" : {
"startTime" : "2024-06-20T18:36:53.195354177Z",
"events" : [ {
"endTime" : "2024-06-20T18:36:53.723847423Z",
"duration" : "PT0.000006182S",
"startTime" : "2024-06-20T18:36:53.723841241Z",
"startupStep" : {
"name" : "spring.beans.instantiate",
"id" : 3,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ],
"parentId" : 2
}
}, {
"endTime" : "2024-06-20T18:36:53.723854225Z",
"duration" : "PT0.000021059S",
"startTime" : "2024-06-20T18:36:53.723833166Z",
"startupStep" : {
"name" : "spring.boot.application.starting",
"id" : 2,
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ]
}
}
清空应用程序启动步骤
要排出并返回在应用程序启动阶段到目前为止记录的步骤,请向 发出请求,如以下基于 curl 的示例所示:POST
/actuator/startup
$ 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" : "3.3.2-SNAPSHOT",
"timeline" : {
"startTime" : "2024-06-20T18:36:53.195354177Z",
"events" : [ {
"endTime" : "2024-06-20T18:36:53.627206153Z",
"duration" : "PT0.000201367S",
"startTime" : "2024-06-20T18:36:53.627004786Z",
"startupStep" : {
"name" : "spring.beans.instantiate",
"id" : 1,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ],
"parentId" : 0
}
}, {
"endTime" : "2024-06-20T18:36:53.627236139Z",
"duration" : "PT0.001084021S",
"startTime" : "2024-06-20T18:36:53.626152118Z",
"startupStep" : {
"name" : "spring.boot.application.starting",
"id" : 0,
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ]
}
}
响应结构
响应包含应用程序启动步骤的详细信息。 下表描述了响应的结构:
路径 | 类型 | 描述 |
---|---|---|
|
|
此应用程序的 Spring Boot 版本。 |
|
|
应用程序的开始时间。 |
|
|
到目前为止,在应用程序启动期间收集的一系列步骤。 |
|
|
此事件开始的时间戳。 |
|
|
此事件结束的时间戳。 |
|
|
此事件的确切持续时间。 |
|
|
StartupStep 的名称。 |
|
|
此 StartupStep 的 ID。 |
|
|
此 StartupStep 的父 ID。 |
|
|
具有附加步骤信息的键/值对数组。 |
|
|
StartupStep 标记的键。 |
|
|
StartupStep 标记的值。 |
路径 | 类型 | 描述 |
---|---|---|
|
|
此应用程序的 Spring Boot 版本。 |
|
|
应用程序的开始时间。 |
|
|
到目前为止,在应用程序启动期间收集的一系列步骤。 |
|
|
此事件开始的时间戳。 |
|
|
此事件结束的时间戳。 |
|
|
此事件的确切持续时间。 |
|
|
StartupStep 的名称。 |
|
|
此 StartupStep 的 ID。 |
|
|
此 StartupStep 的父 ID。 |
|
|
具有附加步骤信息的键/值对数组。 |
|
|
StartupStep 标记的键。 |
|
|
StartupStep 标记的值。 |