From 227deba2231f1824531b0cb9bd23e70eeee9dc89 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Thu, 9 Dec 2021 12:15:33 +0100 Subject: [PATCH] update buckets for client-go latency metrics Current request latency metrics have the following buckets: 0.001, 0.002, 0.004, 0.008, 0.016, 0.032, 0.064, 0.128, 0.256, 0.512 That has two much granularity for http requests, and it gets capped to aprox half seconds, loosing visibility on the requests that may be more interested, the ones that take more than 1 second. Using the same used for etcd request latency, with the same upper and lower limits than the ones used in the apiserver, but only adding one bucket more. []float64{0.005, 0.025, 0.1, 0.25, 0.5, 1.0, 2.0, 4.0, 8.0, 15.0, 30.0, 60.0}, --- .../component-base/metrics/prometheus/restclient/metrics.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/component-base/metrics/prometheus/restclient/metrics.go b/staging/src/k8s.io/component-base/metrics/prometheus/restclient/metrics.go index e272333f859..eeb730ba8b7 100644 --- a/staging/src/k8s.io/component-base/metrics/prometheus/restclient/metrics.go +++ b/staging/src/k8s.io/component-base/metrics/prometheus/restclient/metrics.go @@ -35,7 +35,7 @@ var ( &k8smetrics.HistogramOpts{ Name: "rest_client_request_duration_seconds", Help: "Request latency in seconds. Broken down by verb, and host.", - Buckets: k8smetrics.ExponentialBuckets(0.001, 2, 10), + Buckets: []float64{0.005, 0.025, 0.1, 0.25, 0.5, 1.0, 2.0, 4.0, 8.0, 15.0, 30.0, 60.0}, }, []string{"verb", "host"}, ) @@ -44,7 +44,7 @@ var ( &k8smetrics.HistogramOpts{ Name: "rest_client_rate_limiter_duration_seconds", Help: "Client side rate limiter latency in seconds. Broken down by verb, and host.", - Buckets: k8smetrics.ExponentialBuckets(0.001, 2, 10), + Buckets: []float64{0.005, 0.025, 0.1, 0.25, 0.5, 1.0, 2.0, 4.0, 8.0, 15.0, 30.0, 60.0}, }, []string{"verb", "host"}, )