Counters, Gauges and Histograms
Cheat sheet · https://pcornel.dk/topic.php?topic=6204
Answer
Metric types: counters only increase (reset on restart), gauges go up and down, histograms count observations in buckets (for quantiles), summaries compute quantiles client-side.
Remember
Always use rate()/increase() on counters, never raw values. Histograms can be aggregated across instances; summaries cannot. Choose buckets around your SLO thresholds.
First checks
curl -s localhost:9090/api/v1/metadata?metric=<name>— first check for this topiccurl -s localhost:9090/-/ready— Prometheus readycurl -s 'localhost:9090/api/v1/query?query=up'— scrape targets up/downpromtool check config prometheus.yml— config valid
Verify in this order
observation → typed metric → correct query function
Where it usually breaks
Using a gauge for request counts loses data between scrapes.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6204