應用程式啟動 (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"
}
}
響應結構
響應包含應用程式啟動步驟的詳細資訊。下表描述了響應的結構
| 路徑 | 型別 | 描述 |
|---|---|---|
|
|
此應用程式的 Spring Boot 版本。 |
|
|
應用程式啟動時間。 |
|
|
應用程式啟動過程中迄今為止收集到的步驟陣列。 |
|
|
此事件的開始時間戳。 |
|
|
此事件的結束時間戳。 |
|
|
此事件的精確持續時間。 |
|
|
StartupStep 的名稱。 |
|
|
此 StartupStep 的 ID。 |
|
|
此 StartupStep 的父 ID。 |
|
|
包含附加步驟資訊的鍵/值對陣列。 |
|
|
StartupStep 標籤的鍵。 |
|
|
StartupStep 標籤的值。 |