Browse Source

ref(alerts): Remove try/catch and metric for INC-666 (#76315)

Follow up to https://github.com/getsentry/sentry/pull/69467 to remove a
metric we don't need anymore
Colleen O'Rourke 6 months ago
parent
commit
27da6a78e4
1 changed files with 2 additions and 8 deletions
  1. 2 8
      src/sentry/rules/conditions/event_frequency.py

+ 2 - 8
src/sentry/rules/conditions/event_frequency.py

@@ -27,9 +27,8 @@ from sentry.types.condition_activity import (
     ConditionActivity,
     round_to_five_minute,
 )
-from sentry.utils import metrics
 from sentry.utils.iterators import chunked
-from sentry.utils.snuba import RateLimitExceeded, options_override
+from sentry.utils.snuba import options_override
 
 STANDARD_INTERVALS: dict[str, tuple[str, timedelta]] = {
     "1m": ("one minute", timedelta(minutes=1)),
@@ -183,12 +182,7 @@ class BaseEventFrequencyCondition(EventCondition, abc.ABC):
             return False
         comparison_interval = COMPARISON_INTERVALS[comparison_interval_option][1]
         _, duration = self.intervals[interval]
-        try:
-            current_value = self.get_rate(duration=duration, comparison_interval=comparison_interval, event=event, environment_id=self.rule.environment_id, comparison_type=comparison_type)  # type: ignore[union-attr]
-        # XXX(CEO): once inc-666 work is concluded, rm try/except
-        except RateLimitExceeded:
-            metrics.incr("rule.event_frequency.snuba_query_limit")
-            return False
+        current_value = self.get_rate(duration=duration, comparison_interval=comparison_interval, event=event, environment_id=self.rule.environment_id, comparison_type=comparison_type)  # type: ignore[union-attr]
 
         logging.info("event_frequency_rule current: %s, threshold: %s", current_value, value)
         return current_value > value