mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
Update more metrics names (#3799)
The subsystem of a metric must be it's plugin name. "dns" is reserved for the core. Use a const convention to avoid copy-paste mistakes in naming. Fix dns64 and acl plugin. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
@@ -9,10 +9,6 @@ import (
|
||||
api "k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
const (
|
||||
subsystem = "kubernetes"
|
||||
)
|
||||
|
||||
var (
|
||||
// DnsProgrammingLatency is defined as the time it took to program a DNS instance - from the time
|
||||
// a service or pod has changed to the time the change was propagated and was available to be
|
||||
@@ -27,7 +23,7 @@ var (
|
||||
// * headless_without_selector
|
||||
DnsProgrammingLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Namespace: plugin.Namespace,
|
||||
Subsystem: subsystem,
|
||||
Subsystem: pluginName,
|
||||
Name: "dns_programming_duration_seconds",
|
||||
// From 1 millisecond to ~17 minutes.
|
||||
Buckets: prometheus.ExponentialBuckets(0.001, 2, 20),
|
||||
|
||||
@@ -27,21 +27,23 @@ import (
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
var log = clog.NewWithPlugin("kubernetes")
|
||||
const pluginName = "kubernetes"
|
||||
|
||||
func init() { plugin.Register("kubernetes", setup) }
|
||||
var log = clog.NewWithPlugin(pluginName)
|
||||
|
||||
func init() { plugin.Register(pluginName, setup) }
|
||||
|
||||
func setup(c *caddy.Controller) error {
|
||||
klog.SetOutput(os.Stdout)
|
||||
|
||||
k, err := kubernetesParse(c)
|
||||
if err != nil {
|
||||
return plugin.Error("kubernetes", err)
|
||||
return plugin.Error(pluginName, err)
|
||||
}
|
||||
|
||||
err = k.InitKubeCache(context.Background())
|
||||
if err != nil {
|
||||
return plugin.Error("kubernetes", err)
|
||||
return plugin.Error(pluginName, err)
|
||||
}
|
||||
|
||||
k.RegisterKubeCache(c)
|
||||
|
||||
Reference in New Issue
Block a user