-
Notifications
You must be signed in to change notification settings - Fork 0
/
prometheus_metrics.go
174 lines (153 loc) · 3.98 KB
/
prometheus_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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
package main
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
promEvents = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_events",
Help: "The total number of gitlab events.",
},
[]string{
"type",
"group",
},
)
promProcessedMRs = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_processed_mrs",
Help: "The total number of gitlab merge requests that require assigning reviewers.",
},
[]string{
"group",
},
)
promRemoveReviewer = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_review_removed",
Help: "The total number of times a merge request is set to WIP and then a reviewer removed.",
},
[]string{
"group",
},
)
promRecursiveCalls = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_recursive_calls",
Help: "When this service calls itself after updating a merge request activing the webhooks.",
},
[]string{
"group",
},
)
promErrors = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_errors",
Help: "The total number of errors encountered handling events.",
},
[]string{
"error",
},
)
promIgnoreActions = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_ignore_actions",
Help: "The total number of ignored actions (merge, approve) handling events.",
},
[]string{
"action",
"group",
},
)
promSlackAPIReqs = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_slack_api_reqs",
Help: "The total number of slack api requests",
},
[]string{
"request",
},
)
promSlackAPIErrs = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_slack_api_errors",
Help: "The total number of slack api request errors",
},
[]string{
"request",
"error",
},
)
promSlackMsgs = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_slack_msgs",
Help: "The total number of slack messages sent.",
},
[]string{
"group",
"channel",
},
)
promSlackMsgsErrors = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_slack_msgs_errors",
Help: "Errors encountered when attempting to send slack messages",
},
[]string{
"error",
"group",
"channel",
},
)
promGitlabReqs = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_gitlab_reqs",
Help: "The total number of gitlab requests made.",
},
[]string{
"request",
"method",
"group",
},
)
promCacheRead = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_cache_read",
Help: "Cache reads with hit/miss labels with a reason for miss.",
},
[]string{
"response",
"reason",
},
)
promCacheUpdate = promauto.NewCounter(prometheus.CounterOpts{
Name: "gitlab_mr_wh_cache_updates",
Help: "Cache updates.",
})
promCacheDelete = promauto.NewCounter(prometheus.CounterOpts{
Name: "gitlab_mr_wh_cache_delete",
Help: "Cache delete.",
})
promCacheClear = promauto.NewCounter(prometheus.CounterOpts{
Name: "gitlab_mr_wh_cache_clear",
Help: "Cache entry cleared.",
})
promCacheAdmin = promauto.NewCounter(prometheus.CounterOpts{
Name: "gitlab_mr_wh_cache_admin",
Help: "Cache Admin page accessed.",
})
promSlackUsersMissing = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_no_matching_slack_user",
Help: "A gitlab user in the codeowners does not have a matching entry in slack.",
},
[]string{
"group",
},
)
promSlackStatusUnavailable = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "gitlab_mr_wh_slack_status_unavailable",
Help: "slack status of user means they are unavailable as an approver.",
},
[]string{
"reason",
"group",
},
)
promWorkers = promauto.NewCounter(prometheus.CounterOpts{
Name: "gitlab_mr_wh_workers",
Help: "Number of workers created.",
})
promWorkersWorking = promauto.NewGauge(prometheus.GaugeOpts{
Name: "gitlab_mr_wh_workers_working",
Help: "Number of workers working.",
})
)