Skip to content

Commit a35f2ff

Browse files
author
Christian Roessner
committed
Feat: Add RBL rejection metric
Track the total number of rejected RBL requests by RBL name. This metric will help in understanding the impact of RBLs on request handling. Signed-off-by: Christian Roessner <[email protected]>
1 parent 5e0ee13 commit a35f2ff

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

server/core/features.go

+1
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ func (a *AuthState) processRBL(ctx *gin.Context, rbl *config.RBL, rblChan chan i
255255
}
256256

257257
if isListed {
258+
stats.RBLRejected.WithLabelValues(rblName).Inc()
258259
logMatchedRBL(a, rblName, rbl.Weight)
259260
handleRBLOutcome(waitGroup, rblChan, rbl.Weight)
260261

server/stats/statistics.go

+6
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ var (
237237
Name: "ldap_idle_pool_size",
238238
Help: "Size of idle LDAP pool",
239239
}, []string{"pool"})
240+
241+
// RBLRejected counts the total number of rejected RBL requests, categorized by the RBL that caused the rejection.
242+
RBLRejected = promauto.NewCounterVec(prometheus.CounterOpts{
243+
Name: "rbl_rejected_total",
244+
Help: "The total number of rejected RBL requests",
245+
}, []string{"rbl"})
240246
)
241247

242248
var oldCpu cpu.Stats

0 commit comments

Comments
 (0)