Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Shushlin <v.shushlin@gmail.com>2022-02-17 13:27:27 +0300
committerVladimir Shushlin <v.shushlin@gmail.com>2022-02-21 16:44:20 +0300
commit62a6491652aa6975d9ecf3b9e258766c886d49d4 (patch)
tree18a2ddf45d3e997dbb8ea6a6c27a7da26d6f88be /metrics/metrics.go
parent92fb5e54ad42ed489c4dd93eec69fb5876d11efe (diff)
feat: Add TLS rate limits
Changelog: added
Diffstat (limited to 'metrics/metrics.go')
-rw-r--r--metrics/metrics.go57
1 files changed, 14 insertions, 43 deletions
diff --git a/metrics/metrics.go b/metrics/metrics.go
index e0e4ab29..26c7413f 100644
--- a/metrics/metrics.go
+++ b/metrics/metrics.go
@@ -193,60 +193,31 @@ var (
},
)
- // RateLimitSourceIPCacheRequests is the number of cache hits/misses
- RateLimitSourceIPCacheRequests = prometheus.NewCounterVec(
+ // RateLimitCacheRequests is the number of cache hits/misses
+ RateLimitCacheRequests = prometheus.NewCounterVec(
prometheus.CounterOpts{
- Name: "gitlab_pages_rate_limit_source_ip_cache_requests",
+ Name: "gitlab_pages_rate_limit_cache_requests",
Help: "The number of source_ip cache hits/misses in the rate limiter",
},
[]string{"op", "cache"},
)
- // RateLimitSourceIPCachedEntries is the number of entries in the cache
- RateLimitSourceIPCachedEntries = prometheus.NewGaugeVec(
+ // RateLimitCachedEntries is the number of entries in the cache
+ RateLimitCachedEntries = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
- Name: "gitlab_pages_rate_limit_source_ip_cached_entries",
+ Name: "gitlab_pages_rate_limit_cached_entries",
Help: "The number of entries in the cache",
},
[]string{"op"},
)
- // RateLimitSourceIPBlockedCount is the number of requests that have been blocked by the
- // source IP rate limiter
- RateLimitSourceIPBlockedCount = prometheus.NewGaugeVec(
+ // RateLimitBlockedCount is the number of requests that have been blocked
+ RateLimitBlockedCount = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
- Name: "gitlab_pages_rate_limit_source_ip_blocked_count",
- Help: "The number of requests that have been blocked by the IP rate limiter",
+ Name: "gitlab_pages_rate_limit_blocked_count",
+ Help: "The number of requests/connections that have been blocked by 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"},
+ []string{"limit_name", "enforced"},
)
)
@@ -276,8 +247,8 @@ func MustRegister() {
LimitListenerConcurrentConns,
LimitListenerWaitingConns,
PanicRecoveredCount,
- RateLimitSourceIPCacheRequests,
- RateLimitSourceIPCachedEntries,
- RateLimitSourceIPBlockedCount,
+ RateLimitCacheRequests,
+ RateLimitCachedEntries,
+ RateLimitBlockedCount,
)
}