From bc09a825082dca6262d9ab1ba30254f267c98693 Mon Sep 17 00:00:00 2001 From: Yash Sharma Date: Mon, 1 Mar 2021 17:41:52 +0530 Subject: [PATCH] replaced promauto with prometheus, as earlier was causing unnecessary panic Signed-off-by: Yash Sharma --- pkg/route/handler_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/route/handler_test.go b/pkg/route/handler_test.go index 902bf3936b..6b7cf4db32 100644 --- a/pkg/route/handler_test.go +++ b/pkg/route/handler_test.go @@ -20,7 +20,6 @@ import ( "github.com/jpillora/backoff" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/common/route" "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/storage" @@ -232,19 +231,19 @@ func newHandlerHashring(appendables []*receive.FakeAppendable, replicationFactor Max: 30 * time.Second, Jitter: true, }, - forwardRequests: promauto.NewCounterVec( + forwardRequests: prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "thanos_receive_forward_requests_total", Help: "The number of forward requests.", }, []string{"result"}, ), - replications: promauto.NewCounterVec( + replications: prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "thanos_receive_replications_total", Help: "The number of replication operations done by the receiver. The success of replication is fulfilled when a quorum is met.", }, []string{"result"}, ), - replicationFactor: promauto.NewGauge( + replicationFactor: prometheus.NewGauge( prometheus.GaugeOpts{ Name: "thanos_receive_replication_factor", Help: "The number of times to replicate incoming write requests.",