A Laravel middleware that records every HTTP request above a configurable threshold (default 2 s). Route, status, duration, peak memory, query count + the top-3 parameterised SQL queries that ran inside it. The retroactive log the platform self-monitors with.
CPU at 19% and a four-second checkout are entirely compatible. Only the request knows.
Each slow request carries its top SQL queries, so "why" is on the same page as "what".
One slow request is an anecdote. A route with a 3-second average is a bug.
Anything over your threshold is recorded with its route, method, duration and status.
The slowest SQL statements for that request are captured with it, which is usually where the answer already is.
Individual slow requests are noise. Grouping by route is what shows you the one endpoint worth fixing.
microtime() at start, a query listener that fires only when a query executes, one insert per slow request (and only above threshold).? placeholders intact — values never persist. The parameterised SQL is what aggregates well anyway.HOSTATLAS_SLOW_REQUEST_MS in .env. Production setups often run higher (5 s) to surface only true outliers./up), Vite asset paths and the debugger view to avoid a feedback loop on the table itself.Slow-Request Log is included from Starter. The platform uses the same middleware on itself.