diff options
author | 2018-09-19 05:11:24 -0400 | |
---|---|---|
committer | 2018-09-19 02:11:24 -0700 | |
commit | f9bdd382ddf911c88b33d2bbd8f8aa9be2885a39 (patch) | |
tree | 13a8d3829b2c3560938619df65985fa33c966f41 /plugin/forward/setup.go | |
parent | cb932ca23103485d67e447eeddd855007015d30e (diff) | |
download | coredns-f9bdd382ddf911c88b33d2bbd8f8aa9be2885a39.tar.gz coredns-f9bdd382ddf911c88b33d2bbd8f8aa9be2885a39.tar.zst coredns-f9bdd382ddf911c88b33d2bbd8f8aa9be2885a39.zip |
Ensure Re-register of metrics variables after a reload (#2080)
* - ensure plugins that use prometheus.MustRegister, re-register after reload
- removing once.Do on the startup function was simplest way to do it.
* - fix underscored names (advice of bot)
* - tune existing UT for reload, and add a test verifying failing reload does not prevent correct registering for metrics
* - ensure different ports for tests that can run in same time ..
Diffstat (limited to 'plugin/forward/setup.go')
-rw-r--r-- | plugin/forward/setup.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/plugin/forward/setup.go b/plugin/forward/setup.go index 5743d73b3..23d9acfed 100644 --- a/plugin/forward/setup.go +++ b/plugin/forward/setup.go @@ -38,9 +38,7 @@ func setup(c *caddy.Controller) error { }) c.OnStartup(func() error { - once.Do(func() { - metrics.MustRegister(c, RequestCount, RcodeCount, RequestDuration, HealthcheckFailureCount, SocketGauge) - }) + metrics.MustRegister(c, RequestCount, RcodeCount, RequestDuration, HealthcheckFailureCount, SocketGauge) return f.OnStartup() }) |