From 5c4bf40bad0a8a438fb4a7e1d7011322a741f1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Mon, 8 Apr 2024 12:45:48 +0200 Subject: [PATCH] Improved logs for alias creation rate-limit --- app/rate_limiter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/rate_limiter.py b/app/rate_limiter.py index 40b076d5..39c441e0 100644 --- a/app/rate_limiter.py +++ b/app/rate_limiter.py @@ -30,7 +30,9 @@ def check_bucket_limit( try: value = lock_redis.incr(bucket_lock_name, bucket_seconds) if value > max_hits: - LOG.i(f"Rate limit hit for {bucket_lock_name} -> {value}/{max_hits}") + LOG.i( + f"Rate limit hit for {lock_name} (bucket it {bucket_id} -> {value}/{max_hits}" + ) newrelic.agent.record_custom_event( "BucketRateLimit", {"lock_name": lock_name, "bucket_seconds": bucket_seconds},