From cbd118389be4b62bea4db3d527ba216941e77819 Mon Sep 17 00:00:00 2001 From: Anton Bronnikov Date: Mon, 27 May 2024 17:00:48 +0300 Subject: [PATCH] fix: account or buckets count --- metrics/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics/metrics.go b/metrics/metrics.go index 4df2f7c..d76219d 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -82,7 +82,7 @@ func setupLatencyBoundariesUs(ctx context.Context, cfg *config.Metrics) error { latencyBoundariesUs = otelapi.WithExplicitBucketBoundaries(func() []float64 { base := math.Exp(math.Log(float64(cfg.MaxLatencyUs)) / (float64(cfg.LatencyBucketsCount - 1))) res := make([]float64, 0, cfg.LatencyBucketsCount) - for i := 0; i < 33; i++ { + for i := 0; i < cfg.LatencyBucketsCount; i++ { res = append(res, math.Round(2*math.Pow(base, float64(i)))/2, )