Why it matters

Metrics are the base signal for ops. Understanding types and cardinality traps saves you from expensive mistakes.

Advertisement

The architecture

Counter: monotonically increasing (requests served, errors). Only increases (except reset).

Gauge: current value (CPU %, queue depth). Goes up and down.

Metric typesCountermonotonic incrementGaugecurrent valueHistogramdistribution bucketsCardinality: unique combinations of labels; billions of series overwhelm any backend
Standard metric types.
Advertisement

How it works end to end

Histogram: distribution across buckets. Enables percentile calculations.

Summary: pre-computed percentiles per instance. Cheaper client-side but can't aggregate.

Labels/tags: dimensions on metrics. Enable slicing. Combinations = cardinality.

Cardinality: number of unique label combinations. Prometheus explodes at millions of series.