diff options
author | 2020-07-25 23:06:28 +0800 | |
---|---|---|
committer | 2020-07-25 08:06:28 -0700 | |
commit | 4166dcc2feab0b42b6e7748a6078d0f5d3d54186 (patch) | |
tree | 93ce01fd91b6da6d0457c91e5be21555b686cb55 /plugin/dnssec/metrics.go | |
parent | 05751bdb59737221367f13413a83451e38bce355 (diff) | |
download | coredns-4166dcc2feab0b42b6e7748a6078d0f5d3d54186.tar.gz coredns-4166dcc2feab0b42b6e7748a6078d0f5d3d54186.tar.zst coredns-4166dcc2feab0b42b6e7748a6078d0f5d3d54186.zip |
using promauto package to ensure all created metrics are properly registered (#4025)
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
Diffstat (limited to 'plugin/dnssec/metrics.go')
-rw-r--r-- | plugin/dnssec/metrics.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugin/dnssec/metrics.go b/plugin/dnssec/metrics.go index 20da38f36..e69dbf5c3 100644 --- a/plugin/dnssec/metrics.go +++ b/plugin/dnssec/metrics.go @@ -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", |