HTTP Exchanges (httpexchanges
)
httpexchanges
端点提供有关 HTTP 请求-响应交换的信息。
获取 HTTP 交换信息
要获取 HTTP 交换信息,向 /actuator/httpexchanges
发送 GET
请求,如下面的基于 curl 的示例所示:
$ 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" : "f0a2ad73-296c-4732-9bc1-4cbdee7d38ee"
},
"timeTaken" : "PT0.023S"
} ]
}
响应结构
响应包含已跟踪的 HTTP 请求-响应交换的详细信息。 下表描述了响应的结构:
Path | Type | Description |
---|---|---|
|
|
An array of HTTP request-response exchanges. |
|
|
Timestamp of when the exchange occurred. |
|
|
Principal of the exchange, if any. |
|
|
Name of the principal. |
|
|
HTTP method of the request. |
|
|
Remote address from which the request was received, if known. |
|
|
URI of the request. |
|
|
Headers of the request, keyed by header name. |
|
|
Values of the header |
|
|
Status of the response |
|
|
Headers of the response, keyed by header name. |
|
|
Values of the header |
|
|
Session associated with the exchange, if any. |
|
|
ID of the session. |
|
|
Time taken to handle the exchange. |