mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-05 17:27:51 +00:00
Update comments
This commit is contained in:
parent
00c093074c
commit
fdff124fb1
1 changed files with 1 additions and 3 deletions
|
|
@ -46,7 +46,7 @@ var (
|
|||
[]string{"path", "server"},
|
||||
)
|
||||
|
||||
// define a counter for API errors for various ErrorTypes
|
||||
// define a counter for api requests
|
||||
apiRequestsTotal = metrics.NewCounterVec(
|
||||
&metrics.CounterOpts{
|
||||
Namespace: "prometheus_adapter",
|
||||
|
|
@ -94,10 +94,8 @@ func (c *instrumentedGenericClient) Do(ctx context.Context, verb, endpoint strin
|
|||
endTime := time.Now()
|
||||
if err != nil {
|
||||
if apiErr, wasAPIErr := err.(*client.Error); wasAPIErr {
|
||||
// measure API errors
|
||||
apiRequestsTotal.With(prometheus.Labels{"code": string(apiErr.Type), "path": endpoint, "server": c.serverName}).Inc()
|
||||
} else {
|
||||
// increment a generic error code counter
|
||||
apiRequestsTotal.With(prometheus.Labels{"code": "generic", "path": endpoint, "server": c.serverName}).Inc()
|
||||
}
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue