2018-04-01 11:56:41 +00:00
|
|
|
package example
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
"github.com/coredns/coredns/plugin"
|
|
|
|
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
)
|
|
|
|
|
2018-04-26 20:56:11 +00:00
|
|
|
// requestCount exports a prometheus metric that is incremented every time a query is seen by the example plugin.
|
2018-04-01 11:56:41 +00:00
|
|
|
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
|