Skip to content

Commit

Permalink
Initialize proxy prometheus counters values to 0 (#4283)
Browse files Browse the repository at this point in the history
  • Loading branch information
milosgajdos committed Mar 18, 2024
2 parents 1e3de58 + 6ca646c commit 3cb985c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions registry/proxy/proxymetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ func init() {
}))

metrics.Register(prometheus.ProxyNamespace)
initPrometheusMetrics("blob")
initPrometheusMetrics("manifest")
}

func initPrometheusMetrics(value string) {
requests.WithValues(value).Inc(0)
hits.WithValues(value).Inc(0)
misses.WithValues(value).Inc(0)
pulledBytes.WithValues(value).Inc(0)
pushedBytes.WithValues(value).Inc(0)
}

// BlobPull tracks metrics about blobs pulled into the cache
Expand Down

0 comments on commit 3cb985c

Please sign in to comment.