Browse Source

fix(crons): Add organization id to monitor consumer rate limiter (#50532)

Adds organization id to consumer rate limit key in case monitors share
names across organizations.
Richard Ortenberg 1 year ago
parent
commit
cc01f267c1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/sentry/monitors/consumers/monitor_consumer.py

+ 1 - 1
src/sentry/monitors/consumers/monitor_consumer.py

@@ -107,7 +107,7 @@ def _process_message(wrapper: Dict) -> None:
     environment = params.get("environment")
     project = Project.objects.get_from_cache(id=project_id)
 
-    ratelimit_key = f"{params['monitor_slug']}:{environment}"
+    ratelimit_key = f"{project.organization_id}:{params['monitor_slug']}:{environment}"
 
     metric_kwargs = {
         "source": "consumer",