* - 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 ..
16 lines
363 B
Go
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"})
|
|
)
|