-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics.go
38 lines (32 loc) · 1.06 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
package dcache
import (
"github.com/coredns/coredns/plugin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
cacheHits = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: name,
Name: "hits_total",
Help: "The count of cache hits.",
}, []string{"server"})
cacheMisses = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: name,
Name: "misses_total",
Help: "The count of cache misses.",
}, []string{"server"})
corruptedCache = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: name,
Name: "discard_cache_total",
Help: "The count of cache discard data of corrupted.",
}, []string{"server"})
redisErr = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: name,
Name: "redis_errors_total",
Help: "The count of errors when publish and subscribe entries to redis.",
}, []string{"server"})
)