using promauto package to ensure all created metrics are properly registered (#4025)
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
This commit is contained in:
parent
05751bdb59
commit
4166dcc2fe
31 changed files with 71 additions and 163 deletions
|
@ -4,25 +4,26 @@ import (
|
|||
"github.com/coredns/coredns/plugin"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
)
|
||||
|
||||
var (
|
||||
// cacheSize is the number of elements in the dnssec cache.
|
||||
cacheSize = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
||||
cacheSize = promauto.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{
|
||||
cacheHits = promauto.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{
|
||||
cacheMisses = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: plugin.Namespace,
|
||||
Subsystem: "dnssec",
|
||||
Name: "cache_misses_total",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue