The situation
You have an HTTP API that works. Nobody can tell you whether it is healthy right now, and when it degrades you find out from a user.
Instrument it so that a single dashboard answers three questions during an incident: what is failing, how badly, and since when.
The service you instrument is yours — an API you have already built, or a small one you write for this. Choosing it is not the work.
Where this goes wrong
The instrumentation library is five lines. Everything below is why this is still a real problem.
- Cardinality. A label whose value comes from the request — a path containing an id, a user handle, a query parameter — multiplies your series by every distinct value ever seen. Prometheus does not forget them quickly.
- Buckets. Default histogram buckets are somebody else's latency distribution. If every request lands in one bucket, your p99 is a fiction with a number attached to it.
- Averages. A mean over a bimodal distribution describes no request that ever happened.
- Workers. More than one process behind one port means more than one registry, and a scrape reaches whichever process answers.
- Counter resets. A counter returning to zero on deploy is normal. A panel that reads it as a level instead of a rate is not.
Break it on purpose
A dashboard is worth what it tells you under stress, so find that out before you call this done:
- Make one endpoint slow deliberately, and watch which panel notices first — and how long it takes.
- Send the traffic that would explode cardinality if you had labelled naively, then check your series count.
- Restart the service mid-load and see what your rate panels do at the seam.
- Stop the scrape target and learn how your dashboard shows no data versus zero.