Metric types
A metric is a numeric measurement sampled over time. Most monitoring systems offer three basic shapes, and choosing the right one keeps your data honest.
Counter
A counter only ever goes up, resetting to zero when the process restarts. It tracks cumulative totals such as requests served or errors raised. You rarely read the raw value. Instead you compute a rate, the change per second, which reveals how busy the system is right now.
Gauge
A gauge can rise and fall. It captures a value at a moment, such as memory in use, queue depth, or active connections. You read a gauge directly because its current level is the point.
Histogram
A histogram records the distribution of many observations by sorting them into buckets. From the buckets you estimate percentiles such as the median or the ninety ninth latency. Averages hide outliers, so histograms are essential for understanding tail behavior that users actually feel.
Key idea
Use counters for cumulative totals, gauges for current levels, and histograms for distributions and percentiles.