NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle+1 view

Which technical metrics do you monitor in Prometheus and Grafana (including the P95 and P99 percentiles)?

Practice

AI answer

First and foremost, I monitor metrics that show availability, latency, and resource saturation.

  • Services: requests per second, error rate (including by code and type), and request duration. For latency, I use histograms and look at P50/P95/P99 by route or operation. Percentiles help reveal slow requests that get lost in the average. They can be correctly aggregated across replicas using histogram buckets; precomputed P95/P99 values must not be averaged.
  • Resources and infrastructure: CPU and throttling, memory and OOMs, disk — free space and latency — network, connection counts, and pool status.
  • Dependencies: database latency and errors, connection pools, slow queries, cache hit rate and latency, and errors from external APIs and queues.
  • Application operations: number of active tasks/workers, queue lengths, processing time, restarts, and replica availability.

In Grafana, I correlate metrics with logs and traces, and build dashboards by service and critical operation. I set alert thresholds relative to SLOs and observation windows so that a one-off spike doesn’t create noise. For example, an alert could trigger when the error rate rises persistently or the target P95 is exceeded; P99 is useful for analyzing tail latency, but it’s often noisier and should be assessed in the context of request volume.