From c217c891fff8b488584e87acd10e38c846348e70 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sun, 1 Apr 2018 13:28:37 +0100 Subject: [PATCH] Use new function --- setup.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/setup.go b/setup.go index 4006c51..6772ef3 100644 --- a/setup.go +++ b/setup.go @@ -32,15 +32,7 @@ func setup(c *caddy.Controller) error { // prometheus plugin has been used - if so we will export metrics. We can only register // this metric once, hence the "once.Do". c.OnStartup(func() error { - once.Do(func() { - m := dnsserver.GetConfig(c).Handler("prometheus") - if m == nil { - return - } - if x, ok := m.(*metrics.Metrics); ok { - x.MustRegister(requestCount) - } - }) + once.Do(func() { metrics.MustRegister(c, requestCount) }) return nil })