HTTP 交換 (httpexchanges)

httpexchanges エンドポイントは、HTTP リクエスト / レスポンス交換に関する情報を提供します。

HTTP 交換の取得

HTTP 交換を取得するには、次のカールベースの例に示すように、GET リクエストを /actuator/httpexchanges に送信します。

$ curl 'http://localhost:8080/actuator/httpexchanges' -i -X GET

結果のレスポンスは次のようになります。

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

{
  "exchanges" : [ {
    "timestamp" : "2022-12-22T13:43:41Z",
    "request" : {
      "uri" : "https://api.example.com",
      "method" : "GET",
      "headers" : {
        "Accept" : [ "application/json" ]
      }
    },
    "response" : {
      "status" : 200,
      "headers" : {
        "Content-Type" : [ "application/json" ]
      }
    },
    "principal" : {
      "name" : "alice"
    },
    "session" : {
      "id" : "b5f4969e-6057-4bf8-a78e-d50d0d82530b"
    },
    "timeTaken" : "PT0.023S"
  } ]
}

レスポンス構造

レスポンスには、トレースされた HTTP リクエストとレスポンスの交換の詳細が含まれます。次の表に、レスポンスの構造を示します。

パス タイプ 説明

exchanges

Array

HTTP リクエストとレスポンスの交換の配列。

exchanges.[].timestamp

String

交換が行われたときのタイムスタンプ。

exchanges.[].principal

Object

交換のプリンシパル(ある場合)。

exchanges.[].principal.name

String

プリンシパルの名前。

exchanges.[].request.method

String

リクエストの HTTP メソッド。

exchanges.[].request.remoteAddress

String

リクエストが受信されたリモートアドレス(わかっている場合)。

exchanges.[].request.uri

String

リクエストの URI。

exchanges.[].request.headers

Object

ヘッダー名でキー付けされたリクエストのヘッダー。

exchanges.[].request.headers.*.[]

Array

ヘッダーの値

exchanges.[].response.status

Number

レスポンスのステータス

exchanges.[].response.headers

Object

ヘッダー名でキー付けされたレスポンスのヘッダー。

exchanges.[].response.headers.*.[]

Array

ヘッダーの値

exchanges.[].session

Object

交換に関連付けられたセッション(ある場合)。

exchanges.[].session.id

String

セッションの ID。

exchanges.[].timeTaken

String

交換の処理にかかる時間。