What Is a Gauge Metric? Point-in-Time Values Explained
A gauge metric is a value that can rise and fall over time, capturing the current state of something, like memory in use, temperature, or the number of active connections.
If a counter answers "how many in total," a gauge answers "how much right now." Gauges snapshot a value that fluctuates, and unlike counters, their instantaneous value is exactly what you care about. They are the natural metric for anything that goes both up and down.
A value that moves both ways
A gauge can increase or decrease freely, reflecting a quantity that changes in both directions. Current memory usage, queue depth, active sessions, and available disk space are all gauges. The defining feature is that the metric represents a present-moment measurement, not an accumulation.
Gauge vs counter
The contrast with counters is the clearest way to understand gauges. A counter only goes up and you read its rate; a gauge moves both ways and you read its actual value. Total requests served is a counter; the number of requests in flight right now is a gauge.
How you use gauge data
Because a gauge value is meaningful directly, you typically chart it as-is and aggregate across instances with operations like average, sum, max, or min. You might alert when a gauge crosses a threshold, queue depth too high, free disk too low, since the raw level is what signals trouble.
Sampling and resolution
A gauge is sampled at intervals, so rapid spikes between samples can be missed. Choosing a sensible scrape or sampling frequency matters: too coarse and you overlook brief saturation; too fine and you pay in storage. The right resolution depends on how fast the measured quantity moves.
Gauges in CI/CD
Pipeline gauges include the current build queue length, the number of busy runners, and concurrent jobs in flight. Watching these levels reveals capacity pressure, a queue depth that keeps climbing means jobs are waiting, a signal that runner capacity is the bottleneck.
Key takeaways
- A gauge can go up or down and captures a current value.
- Counters only increase; gauges represent present-moment state.
- You chart and threshold a gauge value directly.
- CI gauges like queue depth and busy runners reveal capacity pressure.