-
Notifications
You must be signed in to change notification settings - Fork 2
/
metrics.go
36 lines (30 loc) · 1.27 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
package warnlist
import (
"github.com/coredns/coredns/plugin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var warnlistCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "warnlist",
Name: "warnlist_hits_total",
Help: "Counter of the number of requests made to warnlisted domains.",
}, []string{"server", "requestor", "domain"})
var warnlistCheckDuration = promauto.NewSummaryVec(prometheus.SummaryOpts{
Namespace: plugin.Namespace,
Subsystem: "warnlist",
Name: "warnlist_cache_check_duration_seconds",
Help: "Summary of the average duration required to check the cache for a warnlisted domain.",
}, []string{"server"})
var warnlistSize = promauto.NewGaugeVec(prometheus.GaugeOpts{
Namespace: plugin.Namespace,
Subsystem: "warnlist",
Name: "warnlist_warnlisted_items_count",
Help: "Counter of the number of currently warnlisted items.",
}, []string{"server"})
var reloadsFailedCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: "warnlist",
Name: "warnlist_failed_reloads_count",
Help: "Counter of the number of times the plugin has failed to reload its warnlist.",
}, []string{"server"})