open-vault/website/content/api-docs/system/in-flight-req.mdx
hghaf099 65845c7531
VAULT-1564 report in-flight requests (#13024)
* VAULT-1564 report in-flight requests

* adding a changelog

* Changing some variable names and fixing comments

* minor style change

* adding unauthenticated support for in-flight-req

* adding documentation for the listener.profiling stanza

* adding an atomic counter for the inflight requests
addressing comments

* addressing comments

* logging completed requests

* fixing a test

* providing log_requests_info as a config option to determine at which level requests should be logged

* removing a member and a method from the StatusHeaderResponseWriter struct

* adding api docks

* revert changes in NewHTTPResponseWriter

* Fix logging invalid log_requests_info value

* Addressing comments

* Fixing a test

* use an tomic value for logRequestsInfo, and moving the CreateClientID function to Core

* fixing go.sum

* minor refactoring

* protecting InFlightRequests from data race

* another try on fixing a data race

* another try to fix a data race

* addressing comments

* fixing couple of tests

* changing log_requests_info to log_requests_level

* minor style change

* fixing a test

* removing the lock in InFlightRequests

* use single-argument form for interface assertion

* adding doc for the new configuration paramter

* adding the new doc to the nav data file

* minor fix
2021-12-08 17:34:42 -05:00

42 lines
1 KiB
Plaintext

---
layout: api
page_title: /sys/in-flight-req - HTTP API
description: The `/sys/in-flight-req` endpoint is used to get information on in-flight requests.
---
# `/sys/in-flight-req`
The `/sys/in-flight-req` endpoint is used to get information on in-flight requests.
The returned information contains the `start_time`, `client_remote_address`, `request_path`,
`request_method`, and `client_id` of the in-flight requests.
## Collect In-Flight Request Information
This endpoint returns the information about the in-flight requests.
| Method | Path |
| :----- | :---------- |
| `GET` | `/sys/in-flight-req` |
### Sample Request
```shell-session
$ curl \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/sys/in-flight-req
```
### Sample Response
```json
{
"9049326b-ceed-1033-c099-96c5cc97db1f": {
"start_time": "2021-11-19T09:13:01.34157-08:00",
"client_remote_address": "127.0.0.3:49816",
"request_path": "/v1/sys/in-flight-req",
"request_method": "GET",
"client_id": "",
}
}
```