Skip to content

Commit

Permalink
Merge pull request kubernetes#13871 from hongkailiu/fix
Browse files Browse the repository at this point in the history
Remove prometheus counter github_requests
  • Loading branch information
k8s-ci-robot authored Aug 13, 2019
2 parents 2334826 + a2677bd commit 43ccd36
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions ghproxy/ghmetrics/ghmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,6 @@ var ghTokenUsageGaugeVec = prometheus.NewGaugeVec(
[]string{"token_hash", "api_version"},
)

// ghRequestsCounter provides the 'github_requests' counter that keeps track
// of the number of GitHub requests by API path.
var ghRequestsCounter = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "github_requests",
Help: "GitHub requests by API path.",
},
[]string{"token_hash", "path", "status"},
)

// ghRequestDurationHistVec provides the 'github_request_duration' histogram that keeps track
// of the duration of GitHub requests by API path.
var ghRequestDurationHistVec = prometheus.NewHistogramVec(
Expand All @@ -73,7 +63,6 @@ var lastGitHubResponse time.Time
func init() {
prometheus.MustRegister(ghTokenUntilResetGaugeVec)
prometheus.MustRegister(ghTokenUsageGaugeVec)
prometheus.MustRegister(ghRequestsCounter)
prometheus.MustRegister(ghRequestDurationHistVec)
}

Expand Down Expand Up @@ -106,7 +95,6 @@ func CollectGitHubTokenMetrics(tokenHash, apiVersion string, headers http.Header
// CollectGitHubRequestMetrics publishes the number of requests by API path to
// `github_requests` on prometheus.
func CollectGitHubRequestMetrics(tokenHash, path, statusCode string, roundTripTime float64) {
ghRequestsCounter.With(prometheus.Labels{"token_hash": tokenHash, "path": GetSimplifiedPath(path), "status": statusCode}).Inc()
ghRequestDurationHistVec.With(prometheus.Labels{"token_hash": tokenHash, "path": GetSimplifiedPath(path), "status": statusCode}).Observe(roundTripTime)
}

Expand Down

0 comments on commit 43ccd36

Please sign in to comment.