-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
metrics.go
32 lines (29 loc) · 935 Bytes
/
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
package dns
import (
"beryju.io/gravity/pkg/extconfig"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
dnsQueries = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gravity_dns_queries",
Help: "DNS queries",
ConstLabels: prometheus.Labels{
"instance": extconfig.Get().Instance.Identifier,
},
}, []string{"queryType", "handler", "zone"})
dnsQueryDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
Name: "gravity_dns_query_duration",
Help: "DNS queries duration",
ConstLabels: prometheus.Labels{
"instance": extconfig.Get().Instance.Identifier,
},
}, []string{"queryType", "handler", "zone"})
)
var dnsRecordsMetric = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "gravity_dns_records",
Help: "DNS records",
ConstLabels: prometheus.Labels{
"instance": extconfig.Get().Instance.Identifier,
},
}, []string{"zone"})