← the index · class 07 · metrics
The average hides the tail
Both. This is the catalogue's GET /products/{id}, over the last 1 000 requests,
loaded 1 000 at a time. Every number below is computed from the requests that were sent.
Why: the distribution
The same requests in the buckets of the histogram that /metrics exports. Almost all of them are in the first buckets; a handful are out in the seconds. The average falls between the two, where there is no request at all. The 95th percentile does not see the tail either: it is 1.5 % of the requests, less than 5 %. The 99th does.
Split by route
«All routes» is the single number of a dashboard nobody split: for the catalogue it is 79.3 ms on average, and 3.85 s at the 99th percentile. Every status has its own row — successes apart from failures.
| Service | Route | Status | Requests | Average | p50 | p95 | p99 | Max |
|---|---|---|---|---|---|---|---|---|
| gateway | all routes | 1 | 469 ms | 469 ms | 469 ms | 469 ms | 469 ms | |
| gateway | POST /orders | 201 | 1 | 469 ms | 469 ms | 469 ms | 469 ms | 469 ms |
| orders | all routes | 1 | 457 ms | 457 ms | 457 ms | 457 ms | 457 ms | |
| orders | POST /orders | 201 | 1 | 457 ms | 457 ms | 457 ms | 457 ms | 457 ms |
| catalogue | all routes | 1 001 | 79.3 ms | 20 ms | 26 ms | 3.85 s | 4.15 s | |
| catalogue | GET /products/{id} | 200 | 1 000 | 79.4 ms | 20 ms | 26 ms | 3.85 s | 4.15 s |
| catalogue | POST /reservations | 200 | 1 | 9 ms | 9 ms | 9 ms | 9 ms | 9 ms |
| payments | all routes | 1 | 410 ms | 410 ms | 410 ms | 410 ms | 410 ms | |
| payments | POST /charges | 201 | 1 | 410 ms | 410 ms | 410 ms | 410 ms | 410 ms |
Requests: since start-up, as in /metrics. Average and percentiles: over the last durations of each series (up to 10 000), nearest rank. The route is the pattern, never the path: one series for every product.
Metrics to alert, logs to explain
The metric cannot say which product is slow — product_id is not an attribute, or there would be one
series per product. The log can: the catalogue writes a WARN line for every read over one second.
| product_id | Slow reads in the log |
|---|---|
| 31 | 15 |