Improved logs for alias creation rate-limit

This commit is contained in:
Adrià Casajús 2024-04-08 12:45:48 +02:00
parent 64fce0fb29
commit 5c4bf40bad
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9
1 changed files with 3 additions and 1 deletions

View File

@ -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},