应用启动(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: 868

{
  "springBootVersion" : "3.5.0",
  "timeline" : {
    "startTime" : "2025-05-26T03:08:26.524630Z",
    "events" : [ {
      "endTime" : "2025-05-26T03:08:26.576737Z",
      "duration" : "PT0.000002S",
      "startTime" : "2025-05-26T03:08:26.576735Z",
      "startupStep" : {
        "name" : "spring.beans.instantiate",
        "id" : 3,
        "tags" : [ {
          "key" : "beanName",
          "value" : "homeController"
        } ],
        "parentId" : 2
      }
    }, {
      "endTime" : "2025-05-26T03:08:26.576739Z",
      "duration" : "PT0.000007S",
      "startTime" : "2025-05-26T03:08:26.576732Z",
      "startupStep" : {
        "name" : "spring.boot.application.starting",
        "id" : 2,
        "tags" : [ {
          "key" : "mainApplicationClass",
          "value" : "com.example.startup.StartupApplication"
        } ]
      }
    } ]
  }
}

提取应用启动步骤

要提取并返回应用启动阶段目前记录的步骤,请对 /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: 868

{
  "springBootVersion" : "3.5.0",
  "timeline" : {
    "startTime" : "2025-05-26T03:08:26.524630Z",
    "events" : [ {
      "endTime" : "2025-05-26T03:08:26.567457Z",
      "duration" : "PT0.000072S",
      "startTime" : "2025-05-26T03:08:26.567385Z",
      "startupStep" : {
        "name" : "spring.beans.instantiate",
        "id" : 1,
        "tags" : [ {
          "key" : "beanName",
          "value" : "homeController"
        } ],
        "parentId" : 0
      }
    }, {
      "endTime" : "2025-05-26T03:08:26.567467Z",
      "duration" : "PT0.000494S",
      "startTime" : "2025-05-26T03:08:26.566973Z",
      "startupStep" : {
        "name" : "spring.boot.application.starting",
        "id" : 0,
        "tags" : [ {
          "key" : "mainApplicationClass",
          "value" : "com.example.startup.StartupApplication"
        } ]
      }
    } ]
  }
}

响应结构

响应包含应用启动步骤的详细信息。 下表描述了响应的结构:

Path Type Description

springBootVersion

String

Spring Boot version for this application.

timeline.startTime

String

Start time of the application.

timeline.events

Array

An array of steps collected during application startup so far.

timeline.events.[].startTime

String

The timestamp of the start of this event.

timeline.events.[].endTime

String

The timestamp of the end of this event.

timeline.events.[].duration

String

The precise duration of this event.

timeline.events.[].startupStep.name

String

The name of the StartupStep.

timeline.events.[].startupStep.id

Number

The id of this StartupStep.

timeline.events.[].startupStep.parentId

Number

The parent id for this StartupStep.

timeline.events.[].startupStep.tags

Array

An array of key/value pairs with additional step info.

timeline.events.[].startupStep.tags[].key

String

The key of the StartupStep Tag.

timeline.events.[].startupStep.tags[].value

String

The value of the StartupStep Tag.