diff options
author | Vladimir Shushlin <v.shushlin@gmail.com> | 2021-12-10 15:14:15 +0300 |
---|---|---|
committer | Vladimir Shushlin <v.shushlin@gmail.com> | 2022-01-11 12:21:44 +0300 |
commit | f62bc0dd08e3a9e14b6bf6c35b04dd6bdcec4491 (patch) | |
tree | 24274bdcd200d7490569415479996c9904a5739e /metrics/metrics.go | |
parent | 2abb995aeb613f184ee0adebfcbd5597ee210169 (diff) |
feat: add domain rate-limiter
Changelog: added
Diffstat (limited to 'metrics/metrics.go')
-rw-r--r-- | metrics/metrics.go | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/metrics/metrics.go b/metrics/metrics.go index 680f7a05..e0e4ab29 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -211,12 +211,40 @@ var ( []string{"op"}, ) - // RateLimitSourceIPBlockedCount is the number of source IPs that have been blocked by the + // RateLimitSourceIPBlockedCount is the number of requests that have been blocked by the // source IP rate limiter RateLimitSourceIPBlockedCount = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "gitlab_pages_rate_limit_source_ip_blocked_count", - Help: "The number of source IP addresses that have been blocked by the rate limiter", + Help: "The number of requests that have been blocked by the IP rate limiter", + }, + []string{"enforced"}, + ) + + // RateLimitDomainCacheRequests is the number of cache hits/misses + RateLimitDomainCacheRequests = prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "gitlab_pages_rate_limit_domain_cache_requests", + Help: "The number of source_ip cache hits/misses in the rate limiter", + }, + []string{"op", "cache"}, + ) + + // RateLimitDomainCachedEntries is the number of entries in the cache + RateLimitDomainCachedEntries = prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Name: "gitlab_pages_rate_limit_domain_cached_entries", + Help: "The number of entries in the cache", + }, + []string{"op"}, + ) + + // RateLimitDomainBlockedCount is the number of requests that have been blocked by the + // domain rate limiter + RateLimitDomainBlockedCount = prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Name: "gitlab_pages_rate_limit_domain_blocked_count", + Help: "The number of requests addresses that have been blocked by the domain rate limiter", }, []string{"enforced"}, ) |