diff options
author | Sashi Kumar <ksashikumark93@gmail.com> | 2020-05-29 00:22:15 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2021-04-21 16:24:25 +0300 |
commit | 811f4e966ae097b50e53c6444ea0aafeb4215999 (patch) | |
tree | c811e8fb49d61bc48369a3995d509a3bc85339d8 /internal/connectioncounter | |
parent | 184ea413f75659a68be2d964b2fb12e512e448ea (diff) |
Use promauto to register Prometheus metrics
Diffstat (limited to 'internal/connectioncounter')
-rw-r--r-- | internal/connectioncounter/connectioncounter.go | 7 |
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. |