Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi Kumar <ksashikumark93@gmail.com>2020-05-29 00:22:15 +0300
committerToon Claes <toon@gitlab.com>2021-04-21 16:24:25 +0300
commit811f4e966ae097b50e53c6444ea0aafeb4215999 (patch)
treec811e8fb49d61bc48369a3995d509a3bc85339d8 /internal/connectioncounter
parent184ea413f75659a68be2d964b2fb12e512e448ea (diff)
Use promauto to register Prometheus metrics
Diffstat (limited to 'internal/connectioncounter')
-rw-r--r--internal/connectioncounter/connectioncounter.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/internal/connectioncounter/connectioncounter.go b/internal/connectioncounter/connectioncounter.go
index 0fbf3210b..1b4bd0b58 100644
--- a/internal/connectioncounter/connectioncounter.go
+++ b/internal/connectioncounter/connectioncounter.go
@@ -4,10 +4,11 @@ import (
"net"
"github.com/prometheus/client_golang/prometheus"
+ "github.com/prometheus/client_golang/prometheus/promauto"
)
var (
- connTotal = prometheus.NewCounterVec(
+ connTotal = promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "gitaly_connections_total",
Help: "Total number of connections accepted by this Gitaly process",
@@ -16,10 +17,6 @@ var (
)
)
-func init() {
- prometheus.MustRegister(connTotal)
-}
-
// New returns a listener which increments a prometheus counter on each
// accepted connection. Use cType to specify the connection type, this is
// a prometheus label.