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