Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
core: add endpoint to prometheus ip_forbidden_blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
h3adex committed Feb 29, 2024
1 parent cc14203 commit 97d188c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 97d188c

Please sign in to comment.