Skip to content

Commit e2e0506

Browse files
kconsandrewshie-sentry
authored andcommitted
fix(anomaly detection): Don't process ABOVE_AND_BELOW for non-dynamic cases (#96861)
Fixes SENTRY-3W4T.
1 parent 7c4056f commit e2e0506

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/sentry/incidents/subscription_processor.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,22 @@ def process_update(self, subscription_update: QuerySubscriptionUpdate) -> None:
515515
is_anomalous, trigger, aggregation_value, fired_incident_triggers
516516
)
517517
else:
518+
# ABOVE_AND_BELOW threshold type is only valid for dynamic detection with anomaly detection enabled
519+
if (
520+
self.alert_rule.threshold_type
521+
== AlertRuleThresholdType.ABOVE_AND_BELOW.value
522+
):
523+
logger.info(
524+
"Skipping processing for ABOVE_AND_BELOW alert rule - anomaly detection likely disabled",
525+
extra={
526+
"rule_id": self.alert_rule.id,
527+
"detection_type": self.alert_rule.detection_type,
528+
"subscription_id": self.subscription.id,
529+
"organization_id": organization.id,
530+
},
531+
)
532+
return
533+
518534
# OVER/UNDER value trigger
519535
alert_operator, resolve_operator = self.THRESHOLD_TYPE_OPERATORS[
520536
AlertRuleThresholdType(self.alert_rule.threshold_type)

0 commit comments

Comments
 (0)