From 97d188cc62d0aec0d9722a219fa849e10f41e205 Mon Sep 17 00:00:00 2001 From: muphoff Date: Thu, 29 Feb 2024 11:52:54 +0100 Subject: [PATCH] core: add endpoint to prometheus ip_forbidden_blocks --- pkg/server/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/server/server.go b/pkg/server/server.go index 25c5498..4bda346 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -67,7 +67,7 @@ var ( ipForbiddenBlocks = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "ip_forbidden_blocks", Help: "Number of requests blocked due to ip blocks", - }, []string{"protocol"}) + }, []string{"protocol", "endpoint"}) tlsFingerprintBlocks = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "tls_fingerprint_blocks", @@ -186,7 +186,7 @@ func (s Server) setupRouter(protocol string) *gin.Engine { tlsFingerprintBlocks.WithLabelValues(protocol, fingerprint).Inc() } case IPForbiddenIdentifier: - ipForbiddenBlocks.WithLabelValues(protocol).Inc() + ipForbiddenBlocks.WithLabelValues(protocol, c.Request.RequestURI).Inc() default: // NoErrorIdentifier, InternalErrorIdentifier: return