Add cache eviction metrics to the cache plugin (#4411)

Signed-off-by: Frank Riley <fhriley@gmail.com>
This commit is contained in:
Frank Riley 2021-03-21 08:58:16 -07:00 committed by GitHub
parent ed3f287fe8
commit 5b9b079dab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 5 deletions

View file

@ -50,4 +50,11 @@ var (
Name: "served_stale_total",
Help: "The number of requests served from stale cache entries.",
}, []string{"server"})
// evictions is the counter of cache evictions.
evictions = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "cache",
Name: "evictions_total",
Help: "The count of cache evictions.",
}, []string{"server", "type"})
)