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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-09 06:09:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-09 06:09:24 +0300
commita25cab22f84ee674ebb32625a6da566acd454e8a (patch)
treef52667dd7f61cace3157fd55c1485cc2becbe3e3 /workhorse/internal/api
parent77914793a349059bf523b131fc925b34349d6884 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'workhorse/internal/api')
-rw-r--r--workhorse/internal/api/api.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/workhorse/internal/api/api.go b/workhorse/internal/api/api.go
index 4ddc66bf26e..17fea398029 100644
--- a/workhorse/internal/api/api.go
+++ b/workhorse/internal/api/api.go
@@ -11,6 +11,7 @@ import (
"strings"
"github.com/prometheus/client_golang/prometheus"
+ "github.com/prometheus/client_golang/prometheus/promauto"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
@@ -34,14 +35,14 @@ type API struct {
}
var (
- requestsCounter = prometheus.NewCounterVec(
+ requestsCounter = promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "gitlab_workhorse_internal_api_requests",
Help: "How many internal API requests have been completed by gitlab-workhorse, partitioned by status code and HTTP method.",
},
[]string{"code", "method"},
)
- bytesTotal = prometheus.NewCounter(
+ bytesTotal = promauto.NewCounter(
prometheus.CounterOpts{
Name: "gitlab_workhorse_internal_api_failure_response_bytes",
Help: "How many bytes have been returned by upstream GitLab in API failure/rejection response bodies.",
@@ -49,11 +50,6 @@ var (
)
)
-func init() {
- prometheus.MustRegister(requestsCounter)
- prometheus.MustRegister(bytesTotal)
-}
-
func NewAPI(myURL *url.URL, version string, roundTripper http.RoundTripper) *API {
return &API{
Client: &http.Client{Transport: roundTripper},