In plain words
Metrics are numbers your services record continuously, such as requests per second, error count and response time, stored as time series so you can graph trends and alert on them cheaply.
Where you see it
A Grafana dashboard for Harbor's API with four panels: requests per second, error rate, p95 latency and the build queue's length. In Harbor's setup, Prometheus collects the numbers from each service's /metrics endpoint every 15 seconds and keeps the history.
What goes wrong
- Watching the average
An average of 200 ms can hide one request in twenty taking four seconds. Track percentiles such as p95 and p99, which show what your slowest users live with.
- A label for every user
Each new label value creates a new time series, so user or order IDs as labels make the metrics store slow and expensive. Keep labels to small sets like route, method and status; put IDs in logs and traces.
http_requests_total{route="/api/checkout", user_id="u_8812"} - Measuring the machine, not the user
CPU and memory can look calm while checkout fails for every customer. Start with what users feel: the rate, errors and duration of each important route.
What to tell your agent
Quick check
Sign in to earn +10 XP for itHarbor's dashboard shows an average API response time of 180 ms, yet support keeps hearing that checkout hangs. What should you look at next?