aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache/metrics.go
diff options
context:
space:
mode:
authorGravatar Frank Riley <fhriley@gmail.com> 2021-03-21 08:58:16 -0700
committerGravatar GitHub <noreply@github.com> 2021-03-21 16:58:16 +0100
commit5b9b079dabc7f71463cea3f0c6a92f338935039d (patch)
treef592af3c022675642e62e959b42803635799da26 /plugin/cache/metrics.go
parented3f287fe8114255739b2c1757a7621ba913244c (diff)
downloadcoredns-5b9b079dabc7f71463cea3f0c6a92f338935039d.tar.gz
coredns-5b9b079dabc7f71463cea3f0c6a92f338935039d.tar.zst
coredns-5b9b079dabc7f71463cea3f0c6a92f338935039d.zip
Add cache eviction metrics to the cache plugin (#4411)
Signed-off-by: Frank Riley <fhriley@gmail.com>
Diffstat (limited to 'plugin/cache/metrics.go')
-rw-r--r--plugin/cache/metrics.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugin/cache/metrics.go b/plugin/cache/metrics.go
index b4b11ae26..f502c238d 100644
--- a/plugin/cache/metrics.go
+++ b/plugin/cache/metrics.go
@@ -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"})
)