Operate
Request inspector
See the latest requests to an app as the router saw them, filter for errors or slow ones, and replay a request to check a fix.
The request inspector keeps the last 500 requests to each app: when they came, what was asked for, what came back and how long it took. When something fails for a user, you can find their request and replay it against your app.
How to use it: open an app's Requests tab, filter by status or path, and replay a request (pages that only read data, since request bodies aren't kept).
Request headers and bodies aren't kept, so nothing sensitive in them is stored.
When something fails for a user, the first question is which request and what came back. The request inspector keeps the latest 500 requests to each app, read from CLI's router.
What you see
Each request shows when it arrived, the method and path, the status, how long the app took, the host it was sent to, the client's address and the response size. Request headers and bodies aren't recorded, so nothing sensitive in them is kept.
Filter by:
- path: any part of it, like
/api/orders; - status:
5xx,4xx,2xxor an exact code like404; - time: slower than a number of milliseconds.
Find the cause
A few patterns to look for:
- The same path failing for everyone: a bug in that route. Open the app's logs (/docs/monitoring) at the time of the first failure.
- Failures from one client address: a misbehaving caller or a scraper. Edge protection (/docs/edge-protection) can rate-limit or block it.
- Slow requests that end in 502 or 504: the app took too long or ran out of memory. Check its metrics, and consider a bigger plan or more copies (/docs/scaling).
Replay a request
After a fix, replay the request that failed and see the new answer. Only GET, HEAD and OPTIONS requests can be replayed, because their bodies aren't needed. The replay carries an X-CLI-Replay header with the request's id, so your app can tell it apart.
Use it
In the dashboard: open the app and choose the Requests tab. Select a row for its details, and press Replay on a GET.
Ask your agent:
"Show me the 500s on web in the last few minutes and what they have in common."
Agents use cli_requests with list and replay.
With the API:
GET /v1/services/:id/request-log?status=5xx&minMs=500
POST /v1/request-samples/:id/replayFor request counts and response times over hours and days, see Monitoring and logs.