tomsun28 commented on code in PR #3673:
URL: https://github.com/apache/hertzbeat/pull/3673#discussion_r2298473344


##########
hertzbeat-alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmCommonReduce.java:
##########
@@ -66,6 +68,22 @@ private void initWorkExecutor() {
     public void reduceAndSendAlarm(SingleAlert alert) {
         workerExecutor.execute(reduceAlarmTask(alert));
     }
+
+    public void reduceAndSendAlarmGroup(Map<String, String> groupLabels, 
List<SingleAlert> alerts) {
+        workerExecutor.execute(() -> {
+            try {
+                // Generate alert fingerprint
+                for (SingleAlert alert : alerts) {
+                    String fingerprint = 
generateAlertFingerprint(alert.getLabels());
+                    alert.setFingerprint(fingerprint);
+                }
+                // Process the group alert
+                alarmGroupReduce.processGroupAlert(groupLabels, alerts);
+            } catch (Exception e) {
+                log.error("Reduce alarm group failed: {}", e.getMessage());
+            }
+        });
+    }

Review Comment:
   here we are handling the group alerts separately with special processing, 
but the `reduce` are design for all alerts which from internal system and 
extern system.  I think we can keep it for now because no new database fields 
have been added.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@hertzbeat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@hertzbeat.apache.org
For additional commands, e-mail: notifications-h...@hertzbeat.apache.org

Reply via email to