aboutsummaryrefslogtreecommitdiff
path: root/middleware/dnssec/handler.go
diff options
context:
space:
mode:
authorGravatar Ben Kochie <superq@gmail.com> 2016-10-31 19:50:50 +0100
committerGravatar Miek Gieben <miek@miek.nl> 2016-10-31 18:50:50 +0000
commit775d26c5e2c09e969dbf4141d82cd7ab6565e6aa (patch)
treea6afe14dbcf27da28d9c43d6817055c6db3b49f5 /middleware/dnssec/handler.go
parent27d893cf33b81e1a419ec58d0512bd2ecb01b8a2 (diff)
downloadcoredns-775d26c5e2c09e969dbf4141d82cd7ab6565e6aa.tar.gz
coredns-775d26c5e2c09e969dbf4141d82cd7ab6565e6aa.tar.zst
coredns-775d26c5e2c09e969dbf4141d82cd7ab6565e6aa.zip
Add metrics for cache hits/misses (#375)
* Add metrics for cache hits/misses Add counters for cache middleware hits and misses. * Add test for cache middleware hit/miss counters. * Fix cache hit metric incrementing. * Add cache hit/miss metrics to dnssec middleware. * Update README metric documentation.
Diffstat (limited to 'middleware/dnssec/handler.go')
-rw-r--r--middleware/dnssec/handler.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/middleware/dnssec/handler.go b/middleware/dnssec/handler.go
index 2b7730083..4c1621c8b 100644
--- a/middleware/dnssec/handler.go
+++ b/middleware/dnssec/handler.go
@@ -53,6 +53,20 @@ var (
Name: "cache_capacity",
Help: "The dnssec cache's capacity.",
}, []string{"type"})
+
+ cacheHits = prometheus.NewCounter(prometheus.CounterOpts{
+ Namespace: middleware.Namespace,
+ Subsystem: subsystem,
+ Name: "cache_hits_total",
+ Help: "The count of cache hits.",
+ })
+
+ cacheMisses = prometheus.NewCounter(prometheus.CounterOpts{
+ Namespace: middleware.Namespace,
+ Subsystem: subsystem,
+ Name: "cache_misses_total",
+ Help: "The count of cache misses.",
+ })
)
// Name implements the Handler interface.
@@ -63,4 +77,6 @@ const subsystem = "dnssec"
func init() {
prometheus.MustRegister(cacheSize)
prometheus.MustRegister(cacheCapacity)
+ prometheus.MustRegister(cacheHits)
+ prometheus.MustRegister(cacheMisses)
}