coredns/plugin/template/metrics.go
Ondřej Benkovský 51f021c079
plugin/template : add view label into plugin metrics (#5620)
Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
2022-09-15 09:36:49 -04:00

32 lines
1.2 KiB
Go

package template
import (
"github.com/coredns/coredns/plugin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
// templateMatchesCount is the counter of template regex matches.
templateMatchesCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "template",
Name: "matches_total",
Help: "Counter of template regex matches.",
}, []string{"server", "zone", "view", "class", "type"})
// templateFailureCount is the counter of go template failures.
templateFailureCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "template",
Name: "template_failures_total",
Help: "Counter of go template failures.",
}, []string{"server", "zone", "view", "class", "type", "section", "template"})
// templateRRFailureCount is the counter of mis-templated RRs.
templateRRFailureCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "template",
Name: "rr_failures_total",
Help: "Counter of mis-templated RRs.",
}, []string{"server", "zone", "view", "class", "type", "section", "template"})
)