1 min readApr 14, 2020
There are the following essential differences between Prometheus histograms and VictoriaMetrics histograms:
- There is no need to define buckets in VictoriaMetrics histograms, since they are statically defined and they cover all the practical value ranges — from
10^-9
(1ns) to10^18
(1000 Petabytes). This allows aggregating any number of VictoriaMetrics histograms, since they have the same set of buckets with identical bucket boundaries. This resolves common issues with Prometheus histograms, when improperly chosen buckets result in accuracy loss or in inability to aggregate histograms with different buckets. - Each
(10^n...10^(n+1)]
range in VictoriaMetrics histograms is split into 18 identically sized bucket with0.5*10^n
step. For instance, the range(1...10]
is split in the following ranges:
(1..1.5] (1.5..2] (2..2.5] (2.5..3] (3..3.5] (3.5..4] (4..4.5] (4.5..5] (5..5.5] (5.5..6] (6..6.5] (6.5..7] (7..7.5] (7.5..8] (8..8.5] [8.5..9] (9..9.5] (9.5..10]
These buckets usually give good enough accuracy for practical cases. Of course, it is possible that all the metric values fall into a single bucket, so you need another set of buckets in order to improve histogram accuracy. But such cases are quite rare in practice. The chosen buckets layout in VictoriaMetrics histogram is a trade-off between practical accuracy and overhead on time series database for storing per-bucket counters.