mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
metrics: correctly register all metrics (#1335)
After initial startup, see if prometheus is loaded and if so, register our metrics with it. Stop doing the init() func and just use the sync.Once so we don't double registrer our metrics.
This commit is contained in:
@@ -18,12 +18,4 @@ var (
|
||||
}, []string{})
|
||||
)
|
||||
|
||||
// OnStartupMetrics sets up the metrics on startup.
|
||||
func OnStartupMetrics() error {
|
||||
metricsOnce.Do(func() {
|
||||
prometheus.MustRegister(AutoPathCount)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
var metricsOnce sync.Once
|
||||
var once sync.Once
|
||||
|
||||
Reference in New Issue
Block a user