intermediate
Metrics
Measure service behavior as time-series counters, gauges, histograms, and service-level indicators for alerting and capacity.
Metrics summarize behavior over time as counters, gauges, histograms, and rates. They power SLIs, capacity planning, alerting, and regression detection after deploys.
| RED (services) | USE (resources) | |----------------|-----------------| | Rate | Utilization | | Errors | Saturation | | Duration | Errors |
httpRequestDuration.observe(
{ method: 'GET', route: '/api/orders', status: '200' },
elapsedSeconds,
);
Control label cardinality — do not put unbounded user IDs on metric labels.
On interviews: latency percentiles, error rate, saturation, RED/USE, cardinality limits, and why averages hide tail latency.
Common pitfalls: high-cardinality labels overwhelm systems; dashboards without SLOs become unused wallpaper.
The trade-off is metric granularity versus storage cost and alert noise.
Checklist:
- Track latency, errors, traffic, saturation.
- Control label cardinality.
- Tie metrics to SLOs and ownership.
- Compare deploy windows for regressions.