|
|
@@ -110,8 +110,13 @@ func (p prometheusProcessor) EventConcurrencyLimited(_ mtglib.EventConcurrencyLi
|
|
110
|
110
|
p.factory.metricConcurrencyLimited.Inc()
|
|
111
|
111
|
}
|
|
112
|
112
|
|
|
113
|
|
-func (p prometheusProcessor) EventIPBlocklisted(_ mtglib.EventIPBlocklisted) {
|
|
114
|
|
- p.factory.metricIPBlocklisted.Inc()
|
|
|
113
|
+func (p prometheusProcessor) EventIPBlocklisted(evt mtglib.EventIPBlocklisted) {
|
|
|
114
|
+ tag := TagIPListBlock
|
|
|
115
|
+ if !evt.IsBlockList {
|
|
|
116
|
+ tag = TagIPListAllow
|
|
|
117
|
+ }
|
|
|
118
|
+
|
|
|
119
|
+ p.factory.metricIPBlocklisted.WithLabelValues(tag).Inc()
|
|
115
|
120
|
}
|
|
116
|
121
|
|
|
117
|
122
|
func (p prometheusProcessor) EventReplayAttack(_ mtglib.EventReplayAttack) {
|
|
|
@@ -150,10 +155,10 @@ type PrometheusFactory struct {
|
|
150
|
155
|
|
|
151
|
156
|
metricTelegramTraffic *prometheus.CounterVec
|
|
152
|
157
|
metricDomainFrontingTraffic *prometheus.CounterVec
|
|
|
158
|
+ metricIPBlocklisted *prometheus.CounterVec
|
|
153
|
159
|
|
|
154
|
160
|
metricDomainFronting prometheus.Counter
|
|
155
|
161
|
metricConcurrencyLimited prometheus.Counter
|
|
156
|
|
- metricIPBlocklisted prometheus.Counter
|
|
157
|
162
|
metricReplayAttacks prometheus.Counter
|
|
158
|
163
|
}
|
|
159
|
164
|
|
|
|
@@ -223,6 +228,11 @@ func NewPrometheus(metricPrefix, httpPath string) *PrometheusFactory { // nolint
|
|
223
|
228
|
Name: MetricDomainFrontingTraffic,
|
|
224
|
229
|
Help: "Traffic which is generated talking with front domain.",
|
|
225
|
230
|
}, []string{TagDirection}),
|
|
|
231
|
+ metricIPBlocklisted: prometheus.NewCounterVec(prometheus.CounterOpts{
|
|
|
232
|
+ Namespace: metricPrefix,
|
|
|
233
|
+ Name: MetricIPBlocklisted,
|
|
|
234
|
+ Help: "A number of rejected sessions due to ip blocklisting.",
|
|
|
235
|
+ }, []string{TagIPList}),
|
|
226
|
236
|
|
|
227
|
237
|
metricDomainFronting: prometheus.NewCounter(prometheus.CounterOpts{
|
|
228
|
238
|
Namespace: metricPrefix,
|
|
|
@@ -234,11 +244,6 @@ func NewPrometheus(metricPrefix, httpPath string) *PrometheusFactory { // nolint
|
|
234
|
244
|
Name: MetricConcurrencyLimited,
|
|
235
|
245
|
Help: "A number of sessions that were rejected by concurrency limiter.",
|
|
236
|
246
|
}),
|
|
237
|
|
- metricIPBlocklisted: prometheus.NewCounter(prometheus.CounterOpts{
|
|
238
|
|
- Namespace: metricPrefix,
|
|
239
|
|
- Name: MetricIPBlocklisted,
|
|
240
|
|
- Help: "A number of rejected sessions due to ip blocklisting.",
|
|
241
|
|
- }),
|
|
242
|
247
|
metricReplayAttacks: prometheus.NewCounter(prometheus.CounterOpts{
|
|
243
|
248
|
Namespace: metricPrefix,
|
|
244
|
249
|
Name: MetricReplayAttacks,
|
|
|
@@ -253,10 +258,10 @@ func NewPrometheus(metricPrefix, httpPath string) *PrometheusFactory { // nolint
|
|
253
|
258
|
|
|
254
|
259
|
registry.MustRegister(factory.metricTelegramTraffic)
|
|
255
|
260
|
registry.MustRegister(factory.metricDomainFrontingTraffic)
|
|
|
261
|
+ registry.MustRegister(factory.metricIPBlocklisted)
|
|
256
|
262
|
|
|
257
|
263
|
registry.MustRegister(factory.metricDomainFronting)
|
|
258
|
264
|
registry.MustRegister(factory.metricConcurrencyLimited)
|
|
259
|
|
- registry.MustRegister(factory.metricIPBlocklisted)
|
|
260
|
265
|
registry.MustRegister(factory.metricReplayAttacks)
|
|
261
|
266
|
|
|
262
|
267
|
return factory
|