diff options
author | 2020-03-31 14:07:36 +0800 | |
---|---|---|
committer | 2020-03-31 08:07:36 +0200 | |
commit | 87214a4c5c05c8918bfe73f734ff4dbd390319dd (patch) | |
tree | 9ca83d03ccdb80572f0166e84add67bb23a1184f /plugin/dnssec/metrics.go | |
parent | 10d176b811e229f2b7bc72c342f54f6acfa69fbd (diff) | |
download | coredns-87214a4c5c05c8918bfe73f734ff4dbd390319dd.tar.gz coredns-87214a4c5c05c8918bfe73f734ff4dbd390319dd.tar.zst coredns-87214a4c5c05c8918bfe73f734ff4dbd390319dd.zip |
introduce metric naming test (#3789)
* introduce metric naming test
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
* Update metrics.go
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
Diffstat (limited to 'plugin/dnssec/metrics.go')
-rw-r--r-- | plugin/dnssec/metrics.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/plugin/dnssec/metrics.go b/plugin/dnssec/metrics.go new file mode 100644 index 000000000..20da38f36 --- /dev/null +++ b/plugin/dnssec/metrics.go @@ -0,0 +1,31 @@ +package dnssec + +import ( + "github.com/coredns/coredns/plugin" + + "github.com/prometheus/client_golang/prometheus" +) + +var ( + // cacheSize is the number of elements in the dnssec cache. + cacheSize = prometheus.NewGaugeVec(prometheus.GaugeOpts{ + Namespace: plugin.Namespace, + Subsystem: "dnssec", + Name: "cache_entries", + Help: "The number of elements in the dnssec cache.", + }, []string{"server", "type"}) + // cacheHits is the count of cache hits. + cacheHits = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: plugin.Namespace, + Subsystem: "dnssec", + Name: "cache_hits_total", + Help: "The count of cache hits.", + }, []string{"server"}) + // cacheMisses is the count of cache misses. + cacheMisses = prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: plugin.Namespace, + Subsystem: "dnssec", + Name: "cache_misses_total", + Help: "The count of cache misses.", + }, []string{"server"}) +) |