应用程序启动 (startup)

startup 端点提供有关应用程序启动序列的信息。

获取应用程序启动步骤

应用程序启动步骤可以作为快照检索(GET)或从缓冲区中排出(POST)。

检索应用程序启动步骤的快照

要检索应用程序启动阶段迄今为止记录的步骤,请向 /actuator/startup 发出 GET 请求,如以下基于 curl 的示例所示

$ curl 'https://: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.0",
  "timeline" : {
    "events" : [ {
      "duration" : "PT0.000004919S",
      "endTime" : "2025-11-20T16:34:00.967233818Z",
      "startTime" : "2025-11-20T16:34:00.967228899Z",
      "startupStep" : {
        "id" : 3,
        "name" : "spring.beans.instantiate",
        "parentId" : 2,
        "tags" : [ {
          "key" : "beanName",
          "value" : "homeController"
        } ]
      }
    }, {
      "duration" : "PT0.000017743S",
      "endTime" : "2025-11-20T16:34:00.967239168Z",
      "startTime" : "2025-11-20T16:34:00.967221425Z",
      "startupStep" : {
        "id" : 2,
        "name" : "spring.boot.application.starting",
        "tags" : [ {
          "key" : "mainApplicationClass",
          "value" : "com.example.startup.StartupApplication"
        } ]
      }
    } ],
    "startTime" : "2025-11-20T16:34:00.724929795Z"
  }
}

排出应用程序启动步骤

要排出并返回应用程序启动阶段迄今为止记录的步骤,请向 /actuator/startup 发出 POST 请求,如以下基于 curl 的示例所示

$ curl 'https://:8080/actuator/startup' -i -X POST

结果响应类似于以下内容

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 889

{
  "springBootVersion" : "4.0.0",
  "timeline" : {
    "events" : [ {
      "duration" : "PT0.000241159S",
      "endTime" : "2025-11-20T16:34:00.901447942Z",
      "startTime" : "2025-11-20T16:34:00.901206783Z",
      "startupStep" : {
        "id" : 1,
        "name" : "spring.beans.instantiate",
        "parentId" : 0,
        "tags" : [ {
          "key" : "beanName",
          "value" : "homeController"
        } ]
      }
    }, {
      "duration" : "PT0.006622839S",
      "endTime" : "2025-11-20T16:34:00.901482577Z",
      "startTime" : "2025-11-20T16:34:00.894859738Z",
      "startupStep" : {
        "id" : 0,
        "name" : "spring.boot.application.starting",
        "tags" : [ {
          "key" : "mainApplicationClass",
          "value" : "com.example.startup.StartupApplication"
        } ]
      }
    } ],
    "startTime" : "2025-11-20T16:34:00.724929795Z"
  }
}

响应结构

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

路径 类型 描述

springBootVersion

字符串

此应用程序的 Spring Boot 版本。

timeline.startTime

字符串

应用程序启动时间。

timeline.events

数组

应用程序启动过程中迄今为止收集到的步骤数组。

timeline.events.[].startTime

字符串

此事件的开始时间戳。

timeline.events.[].endTime

字符串

此事件的结束时间戳。

timeline.events.[].duration

字符串

此事件的精确持续时间。

timeline.events.[].startupStep.name

字符串

StartupStep 的名称。

timeline.events.[].startupStep.id

数字

此 StartupStep 的 ID。

timeline.events.[].startupStep.parentId

数字

此 StartupStep 的父 ID。

timeline.events.[].startupStep.tags

数组

包含附加步骤信息的键/值对数组。

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

字符串

StartupStep 标签的键。

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

字符串

StartupStep 标签的值。

© . This site is unofficial and not affiliated with VMware.