-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmetrics.go
87 lines (75 loc) · 2.67 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package coredns_mysql_extend
import (
"github.com/coredns/coredns/plugin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
// Variables declared for monitoring.
var (
openMysqlCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "open_mysql_total",
Help: "Counter of open mysql instance.",
}, []string{"status"})
createTableCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "create_table_total",
Help: "Counter of create table",
}, []string{"status", "table_name"})
degradeCacheCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "degrade_cache_total",
Help: "Counter of degrade cache.",
}, []string{"option", "status", "fqdn", "qtype"})
zoneFindCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "zone_find_total",
Help: "Counter of zone find.",
}, []string{"status"})
callNextPluginCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "call_next_plugin_total",
Help: "Counter of next plugin call.",
}, []string{"fqdn", "qtype"})
queryDBCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "query_db_total",
Help: "Counter of query db.",
}, []string{"status"})
makeAnswerCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "make_answer_total",
Help: "Counter of make answer count.",
}, []string{"status"})
dbPingCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "db_ping_total",
Help: "Counter of DB ping.",
}, []string{"status"})
dbGetZoneCount = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "db_get_zone_total",
Help: "Counter of db get zone.",
}, []string{"status"})
loadLocalData = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "load_local_data_total",
Help: "Counter of load local data.",
}, []string{"status"})
dumpLocalData = promauto.NewCounterVec(prometheus.CounterOpts{
Namespace: plugin.Namespace,
Subsystem: pluginName,
Name: "dump_local_data_total",
Help: "Counter of dump local data.",
}, []string{"status"})
)