Metric Types

Every metric Kloudfuse stores is one of three types, set by however the source instrumented it. The type determines what aggregations and functions make sense against it — this page covers what each type represents and when to reach for it; see PromQL for the full function reference each type supports.

To check a metric’s type in the UI, open its dropdown in the Explorer's metric selector and hover over a result — the type appears alongside its description, or use the Cardinality Explorer, which lists type in its Metrics column.

Counter

A counter is a cumulative value that only ever increases, or resets to zero on restart — the number of requests served, tasks completed, or errors raised. Because a counter never decreases on its own, it’s rarely useful raw; wrap it in rate() or increase() to get a per-second or per-interval rate, which is what most counter-based charts and alerts actually plot.

Use a counter for anything that only accumulates. Don’t use one for a value that can go down on its own — the number of currently running processes, for example — that’s a gauge instead.

Gauge

A gauge is a single numerical value that can move in either direction — temperature, memory usage, the number of active connections, or a count that goes up and down like concurrent requests. Unlike a counter, a gauge’s raw value is usually what you want to chart directly; aggregate it with avg, min, max, or sum rather than rate().

Histogram

A histogram samples observed values — request durations, response sizes — into configurable buckets and also tracks their count and sum. It’s the most complex of the three types and the one to reach for whenever you need a distribution or a percentile rather than a single number, such as p95 latency.

Bucket boundaries are set by whoever instruments the metric, and querying a histogram means aggregating across its buckets — most commonly with histogram_quantile() to compute a percentile. See Miscellaneous functions for histogram_quantile() and the related histogram_avg(), histogram_stddev(), histogram_stdvar(), and histogram_fraction() functions.

Native and exponential histograms

A standard histogram’s buckets are fixed at instrumentation time — get them wrong and you lose resolution you can’t recover later. Two newer histogram formats solve this with dynamic bucketing, and Kloudfuse ingests both natively, with no conversion step:

Prometheus Native Histograms

A dynamic bucket schema that automatically adjusts resolution to the observed data’s actual distribution, instead of buckets fixed in advance. Requires Prometheus 2.40+ with the native-histograms feature enabled and send_native_histograms: true set in the remote-write config — see Prometheus Remote Write Integration.

OpenTelemetry Exponential Histograms

Bucket boundaries computed by an exponential formula, giving high resolution for small values and automatically coarsening for large ones. Configured as the aggregation for a histogram instrument in an OTel SDK’s meter provider.

Both formats query with the same histogram_quantile() and related functions as a standard histogram — nothing about the query changes, only how precisely the underlying buckets represent the real distribution.

See also