アプリケーションの起動 (startup
)
startup
エンドポイントは、アプリケーションの起動シーケンスに関する情報を提供します。
アプリケーションの起動手順の取得
アプリケーションの起動ステップは、スナップショットとして取得するか (GET
)、バッファから排出する (POST
) ことができます。
アプリケーション起動ステップのスナップショットを取得する
アプリケーションの起動フェーズ中にこれまでに記録されたステップを取得するには、次の curl ベースの例に示すように、GET
リクエストを /actuator/startup
に送信します。
$ 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: 888
{
"springBootVersion" : "3.3.1",
"timeline" : {
"startTime" : "2024-06-20T09:58:14.254959581Z",
"events" : [ {
"endTime" : "2024-06-20T09:58:14.557930934Z",
"duration" : "PT0.00000547S",
"startTime" : "2024-06-20T09:58:14.557925464Z",
"startupStep" : {
"name" : "spring.beans.instantiate",
"id" : 3,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ],
"parentId" : 2
}
}, {
"endTime" : "2024-06-20T09:58:14.557936945Z",
"duration" : "PT0.000018555S",
"startTime" : "2024-06-20T09:58:14.557918390Z",
"startupStep" : {
"name" : "spring.boot.application.starting",
"id" : 2,
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ]
}
}
アプリケーションの起動手順の実行
アプリケーションの起動フェーズ中にこれまでに記録されたステップを排出して返すには、次の curl ベースの例に示すように、POST
リクエストを /actuator/startup
に作成します。
$ 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: 889
{
"springBootVersion" : "3.3.1",
"timeline" : {
"startTime" : "2024-06-20T09:58:14.254959581Z",
"events" : [ {
"endTime" : "2024-06-20T09:58:14.505354503Z",
"duration" : "PT0.000201758S",
"startTime" : "2024-06-20T09:58:14.505152745Z",
"startupStep" : {
"name" : "spring.beans.instantiate",
"id" : 1,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ],
"parentId" : 0
}
}, {
"endTime" : "2024-06-20T09:58:14.505381243Z",
"duration" : "PT0.001108614S",
"startTime" : "2024-06-20T09:58:14.504272629Z",
"startupStep" : {
"name" : "spring.boot.application.starting",
"id" : 0,
"tags" : [ {
"key" : "mainApplicationClass",
"value" : "com.example.startup.StartupApplication"
} ]
}
} ]
}
}
レスポンス構造
レスポンスには、アプリケーションの起動手順の詳細が含まれます。次の表は、レスポンスの構造を示しています。
パス | タイプ | 説明 |
---|---|---|
|
| このアプリケーションの Spring Boot バージョン。 |
|
| アプリケーションの開始時刻。 |
|
| アプリケーションの起動中にこれまでに収集されたステップの配列。 |
|
| このイベントの開始時のタイムスタンプ。 |
|
| このイベントの終了のタイムスタンプ。 |
|
| このイベントの正確な期間。 |
|
| StartupStep の名前。 |
|
| この StartupStep の ID。 |
|
| この StartupStep の親 ID。 |
|
| 追加のステップ情報を含むキーと値のペアの配列。 |
|
| StartupStep タグのキー。 |
|
| StartupStep タグの値。 |