Histogram bucket configuration impacts cardinality and accuracy
infoperformanceUpdated Mar 7, 2026(via Exa)
Technologies:
How to detect:
Duration histogram metrics can be configured using explicit buckets, exponential buckets (min/max/factor), or default Prometheus buckets. Incorrect bucket configuration leads to poor histogram accuracy or excessive cardinality.
Recommended action:
Configure histogram buckets based on expected latency distribution. Use explicit buckets for known patterns: metrics.duration.buckets: [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0]. For wide ranges, use exponential: metrics.duration.min, metrics.duration.max, metrics.duration.factor. Monitor cardinality to avoid overwhelming Prometheus.