應用程式啟動 (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.