| 此版本仍在开发中,尚不被认为是稳定的。对于最新的稳定版本,请使用 Spring Boot 3.5.5! | 
应用程序启动 (startup)
这startupendpoint 提供有关应用程序启动顺序的信息。
检索应用程序启动步骤
应用程序启动步骤可以作为快照 (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: 897
{
  "springBootVersion" : "4.0.0-SNAPSHOT",
  "timeline" : {
    "events" : [ {
      "duration" : "PT0.00000526S",
      "endTime" : "2025-08-21T02:28:20.534886660Z",
      "startTime" : "2025-08-21T02:28:20.534881400Z",
      "startupStep" : {
        "id" : 3,
        "name" : "spring.beans.instantiate",
        "parentId" : 2,
        "tags" : [ {
          "key" : "beanName",
          "value" : "homeController"
        } ]
      }
    }, {
      "duration" : "PT0.000019165S",
      "endTime" : "2025-08-21T02:28:20.534891819Z",
      "startTime" : "2025-08-21T02:28:20.534872654Z",
      "startupStep" : {
        "id" : 2,
        "name" : "spring.boot.application.starting",
        "tags" : [ {
          "key" : "mainApplicationClass",
          "value" : "com.example.startup.StartupApplication"
        } ]
      }
    } ],
    "startTime" : "2025-08-21T02:28:20.302156719Z"
  }
}清空应用程序启动步骤
要清空并返回到目前为止在应用程序启动阶段记录的步骤,请将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: 898
{
  "springBootVersion" : "4.0.0-SNAPSHOT",
  "timeline" : {
    "events" : [ {
      "duration" : "PT0.000249724S",
      "endTime" : "2025-08-21T02:28:20.419568837Z",
      "startTime" : "2025-08-21T02:28:20.419319113Z",
      "startupStep" : {
        "id" : 1,
        "name" : "spring.beans.instantiate",
        "parentId" : 0,
        "tags" : [ {
          "key" : "beanName",
          "value" : "homeController"
        } ]
      }
    }, {
      "duration" : "PT0.001829036S",
      "endTime" : "2025-08-21T02:28:20.419590898Z",
      "startTime" : "2025-08-21T02:28:20.417761862Z",
      "startupStep" : {
        "id" : 0,
        "name" : "spring.boot.application.starting",
        "tags" : [ {
          "key" : "mainApplicationClass",
          "value" : "com.example.startup.StartupApplication"
        } ]
      }
    } ],
    "startTime" : "2025-08-21T02:28:20.302156719Z"
  }
}响应结构
响应包含应用程序启动步骤的详细信息。 下表描述了响应的结构:
| 路径 | 类型 | 描述 | 
|---|---|---|
| 
 | 
 | 此应用程序的 Spring Boot 版本。 | 
| 
 | 
 | 应用程序的开始时间。 | 
| 
 | 
 | 到目前为止,在应用程序启动期间收集的一系列步骤。 | 
| 
 | 
 | 此事件开始的时间戳。 | 
| 
 | 
 | 此事件结束的时间戳。 | 
| 
 | 
 | 此事件的确切持续时间。 | 
| 
 | 
 | StartupStep 的名称。 | 
| 
 | 
 | 此 StartupStep 的 ID。 | 
| 
 | 
 | 此 StartupStep 的父 ID。 | 
| 
 | 
 | 带有其他步骤信息的键/值对数组。 | 
| 
 | 
 | StartupStep 标记的键。 | 
| 
 | 
 | StartupStep 标记的值。 |