アプリケーションの起動 (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.4.1",
"timeline" : {
"startTime" : "2024-12-19T11:43:46.181222490Z",
"events" : [ {
"endTime" : "2024-12-19T11:43:46.697791814Z",
"duration" : "PT0.00000533S",
"startTime" : "2024-12-19T11:43:46.697786484Z",
"startupStep" : {
"name" : "spring.beans.instantiate",
"id" : 3,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ],
"parentId" : 2
}
}, {
"endTime" : "2024-12-19T11:43:46.697797935Z",
"duration" : "PT0.000018995S",
"startTime" : "2024-12-19T11:43:46.697778940Z",
"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.4.1",
"timeline" : {
"startTime" : "2024-12-19T11:43:46.181222490Z",
"events" : [ {
"endTime" : "2024-12-19T11:43:46.617093939Z",
"duration" : "PT0.000222547S",
"startTime" : "2024-12-19T11:43:46.616871392Z",
"startupStep" : {
"name" : "spring.beans.instantiate",
"id" : 1,
"tags" : [ {
"key" : "beanName",
"value" : "homeController"
} ],
"parentId" : 0
}
}, {
"endTime" : "2024-12-19T11:43:46.617123635Z",
"duration" : "PT0.001177236S",
"startTime" : "2024-12-19T11:43:46.615946399Z",
"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 タグの値。 |