-
Notifications
You must be signed in to change notification settings - Fork 9
/
metrics.go
47 lines (38 loc) · 1.37 KB
/
metrics.go
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package blocklist
import (
"sync"
"github.com/coredns/coredns/plugin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var blockCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "blocklist",
Name: "block_count_total",
Help: "Counter of blocks made.",
}, []string{"server"})
var allowCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "blocklist",
Name: "allow_count_total",
Help: "Counter of allows that have overridden blocks.",
}, []string{"server"})
var blockWithDomainsCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "blocklist",
Name: "block_count_with_domains_total",
Help: "Counter of blocks made.",
}, []string{"server", "domain"})
var allowWithDomainsCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "blocklist",
Name: "allow_count_with_domains_total",
Help: "Counter of allows that have overridden blocks, with domain.",
}, []string{"server", "domain"})
var domainCount = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: plugin.Namespace,
Subsystem: "blocklist",
Name: "list_size",
Help: "Number of domains in list.",
}, []string{"file"})
var once sync.Once