Metric Types
Learn about the four different Prometheus metric types: counter, gauge, summary, and histogram.
Last updated
Learn about the four different Prometheus metric types: counter, gauge, summary, and histogram.
Last updated
Counters track values that can only increase, like HTTP request counts or CPU seconds used.
Functions that are commonly used with counters are:
Gauges track values that can increase or decrease, like temperatures or disk space.
Usually, gauges do not need to be operated on by functions before they can be graphed.
Summaries calculate client-side-calculated quantiles from observations, like request latency percentiles. They also track the total count and total sum of observations.
NOTE: Summaries cannot be aggregated across labels or multiple instances.
NOTICE: The client has already reduced summaries into a floating point number.
Histograms track cumulative bucketed counts of observations, such as request durations. They also track the total count and total sum of observations.
Histograms need to be processed by the Prometheus server. They also will always have the label "le" denoting the upper bound of the bucket.
NOTICE: Histograms are observed as counts, similar to the counter metric type.
Both histogram and summary metrics can be used to calculate quantiles, but they have different trade-offs. The most important is that summary metrics cannot be aggregated over dimensions or multiple instances. The official documentation provides an in-depth analysis of the differences.