coredns-ldap/metrics.go
Miek Gieben ae199bcc5c add metrics in the example
Add metrics as well (good example to have).
2018-04-01 12:56:41 +01:00

21 lines
483 B
Go

package example
import (
"sync"
"github.com/coredns/coredns/plugin"
"github.com/prometheus/client_golang/prometheus"
)
// requestCount exports a prometheus metric that is incremented every time
// a query is seen by the example plugin.
var requestCount = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "example",
Name: "request_count_total",
Help: "Counter of requests made.",
}, []string{"server"})
var once sync.Once