From 5a558ab4bdf82199a90f0d65da3b797685eabbb0 Mon Sep 17 00:00:00 2001 From: Cezary Zawadka Date: Tue, 10 May 2022 12:31:29 +0200 Subject: [PATCH] Buckets in gce_api_request_duration_seconds metric Define Buckets in gce_api_request_duration_seconds metric to cover latencies from 5ms to 5 minutes+ The default buckets: ` DefBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}` defined in, github.com/prometheus/client_golang/prometheus/histogram.go do not cover long running requests, e.g. backend service update takes 30-40 seconds. --- pkg/composite/metrics/metrics.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/composite/metrics/metrics.go b/pkg/composite/metrics/metrics.go index 8c6906cc0b..c003b92c90 100644 --- a/pkg/composite/metrics/metrics.go +++ b/pkg/composite/metrics/metrics.go @@ -84,8 +84,10 @@ func registerAPIMetrics(attributes ...string) *apiCallMetrics { metrics := &apiCallMetrics{ latency: prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: "gce_api_request_duration_seconds", // TODO: (shance) reconcile with cloudprovider - Help: "Latency of a GCE API call", + Name: "gce_api_request_duration_seconds", // TODO: (shance) reconcile with cloudprovider + Help: "Latency of a GCE API call", + Buckets: []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 20, 40, 80, 160, 320}, + }, attributes, ),