-
Notifications
You must be signed in to change notification settings - Fork 76
Description
As described in this blog, VictoriaMetrics histograms do not require pre-defining bucket ranges or bucket numbers; instead, buckets are created dynamically as needed.
However, from the code, the bucketsCount is hardcoded asdecimalBucketsCount * bucketsPerDecimal=27 * 18 = 486
https://github.com/VictoriaMetrics/metrics/blob/58ce9991981bd6363af8c6f5a2c907f4e4f554fc/histogram.go#L11-17
But there are cases where users do not require such high granularity in histograms. For example, the metric vm_http_request_duration_seconds{path="/metrics"} is present on all VictoriaMetrics servers, but users may not need high granular buckets like vmrange="1.668e-05...1.896e-05", vmrange="1.292e-05...1.468e-05". Having these small granularity buckets increases the number of exposed series unnecessarily.
Describe the solution you'd like
It would be great to support limiting the bucket count when creating a histogram by configuring parameters such as MaxBucketNumber, and the bucket range can dynamically adapt to the new value;
Or support changing buckets resolution by adjusting bucketsPerDecimal.
However, since the bucket configuration is no long static, users cannot perform histogram calculations across different time series if any of them has customized bucket option settings.
Additional information:
Prometheus native histograms supports changing NativeHistogramBucketFactor or limiting the bucket count, see https://prometheus.io/docs/specs/native_histograms/#limiting-the-bucket-count.