@@ -503,10 +503,21 @@ def process_update(self, subscription_update: QuerySubscriptionUpdate) -> None:
503
503
if has_anomaly (
504
504
potential_anomaly , trigger .label
505
505
) and not self .check_trigger_matches_status (trigger , TriggerStatus .ACTIVE ):
506
- metrics .incr (
507
- "incidents.alert_rules.threshold.alert" ,
508
- tags = {"detection_type" : self .alert_rule .detection_type },
509
- )
506
+ if features .has (
507
+ "organizations:workflow-engine-metric-alert-dual-processing-logs"
508
+ ):
509
+ metrics .incr (
510
+ "incidents.alert_rules.threshold.alert" ,
511
+ tags = {
512
+ "detection_type" : self .alert_rule .detection_type ,
513
+ "organization_id" : self .alert_rule .organization_id ,
514
+ },
515
+ )
516
+ else :
517
+ metrics .incr (
518
+ "incidents.alert_rules.threshold.alert" ,
519
+ tags = {"detection_type" : self .alert_rule .detection_type },
520
+ )
510
521
incident_trigger = self .trigger_alert_threshold (
511
522
trigger , aggregation_value
512
523
)
@@ -520,10 +531,21 @@ def process_update(self, subscription_update: QuerySubscriptionUpdate) -> None:
520
531
and self .active_incident
521
532
and self .check_trigger_matches_status (trigger , TriggerStatus .ACTIVE )
522
533
):
523
- metrics .incr (
524
- "incidents.alert_rules.threshold.resolve" ,
525
- tags = {"detection_type" : self .alert_rule .detection_type },
526
- )
534
+ if features .has (
535
+ "organizations:workflow-engine-metric-alert-dual-processing-logs"
536
+ ):
537
+ metrics .incr (
538
+ "incidents.alert_rules.threshold.resolve" ,
539
+ tags = {
540
+ "detection_type" : self .alert_rule .detection_type ,
541
+ "organization_id" : self .alert_rule .organization_id ,
542
+ },
543
+ )
544
+ else :
545
+ metrics .incr (
546
+ "incidents.alert_rules.threshold.resolve" ,
547
+ tags = {"detection_type" : self .alert_rule .detection_type },
548
+ )
527
549
incident_trigger = self .trigger_resolve_threshold (
528
550
trigger , aggregation_value
529
551
)
0 commit comments