Which technical metrics do you monitor in Prometheus and Grafana (including the P95 and P99 percentiles)?
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.
Also asked at Коммит (Аутстафф на проект "Ростелекома")
- How to protect the system from creating multiple payments if the user presses the pay button many times?
- How is the N+1 query problem solved in ORM?
- What types of indexes are available in PostgreSQL?
- There are several services (2-3), and there is an end-to-end business scenario passing through all services. If an operation on one of the services in the middle or at the end fails, the system ends up in an inconsistent state. What methods can be used to achieve inter-service transactionality (either the entire scenario is applied, or none of it is), if each service has its own database?
- What databases have you worked with the most?
Similar questions
- What systems or tools have you worked with? Prometheus, for example?
- Which tools for monitoring, tracing, and logging have you used at work?
- How would you organize load testing for the designed service: what baseline scenarios, signs of degradation, and Kubernetes container metrics should be monitored?
- What do you consider a high load: how many requests per second or per minute?
- Have you worked with search metrics, and what are they?