Interview Prep/Python for DevOps/Testing, services & metrics

What metric types does `prometheus_client` provide?

BeginnerConceptTesting, services & metrics
Answer
  • Counter: only goes up (resets on restart). Requests served, findings detected. Query with rate().
  • Gauge: goes up and down. Queue depth, in-flight requests, last successful run timestamp.
  • Histogram: observations in configurable buckets, plus _sum and _count. Request latency; aggregatable across instances with histogram_quantile().
  • Summary: client-side quantiles; cheap but cannot be aggregated across instances.

Prefer histograms for latency in anything that runs as more than one replica.

All Python for DevOps questions Roadmap: Python for automation

More on Testing, services & metrics