coredns/plugin/autopath/metrics.go
Francois Tur f9bdd382dd 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 ..
2018-09-19 02:11:24 -07:00

16 lines
363 B
Go

package autopath
import (
"github.com/coredns/coredns/plugin"
"github.com/prometheus/client_golang/prometheus"
)
var (
autoPathCount = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "autopath",
Name: "success_count_total",
Help: "Counter of requests that did autopath.",
}, []string{"server"})
)