-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetrics.go
More file actions
28 lines (22 loc) · 827 Bytes
/
metrics.go
File metadata and controls
28 lines (22 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package coredns_nftables
import (
"sync"
"github.com/coredns/coredns/plugin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
// recordCount exports a prometheus metric that is incremented every time a query is seen by the example plugin.
var recordCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "nftables",
Name: "record_count_total",
Help: "Counter of requests processed.",
}, []string{"server"})
var recordDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
Namespace: plugin.Namespace,
Subsystem: "nftables",
Name: "record_duration_microseconds",
Buckets: plugin.TimeBuckets,
Help: "Histogram of the time each record took.",
}, []string{"server"})
var _ sync.Once