diff --git a/alerter/src/main/java/org/apache/hertzbeat/alert/calculate/CalculateAlarm.java b/alerter/src/main/java/org/apache/hertzbeat/alert/calculate/CalculateAlarm.java index 858c9e20b18..46a7cf6f6eb 100644 --- a/alerter/src/main/java/org/apache/hertzbeat/alert/calculate/CalculateAlarm.java +++ b/alerter/src/main/java/org/apache/hertzbeat/alert/calculate/CalculateAlarm.java @@ -179,7 +179,7 @@ private void calculate(CollectRep.MetricsData metricsData) { String alarmKey = String.valueOf(monitorId) + define.getId(); triggeredAlertMap.remove(alarmKey); if (define.isRecoverNotice()) { - handleRecoveredAlert(currentTimeMilli, define, expr, alarmKey); + handleRecoveredAlert(currentTimeMilli, define, alarmKey); } } } catch (Exception e) { @@ -234,7 +234,7 @@ private void calculate(CollectRep.MetricsData metricsData) { String alarmKey = String.valueOf(monitorId) + define.getId() + tagBuilder; triggeredAlertMap.remove(alarmKey); if (define.isRecoverNotice()) { - handleRecoveredAlert(currentTimeMilli, define, expr, alarmKey); + handleRecoveredAlert(currentTimeMilli, define, alarmKey); } } } catch (Exception e) { @@ -246,12 +246,12 @@ private void calculate(CollectRep.MetricsData metricsData) { } } - private void handleRecoveredAlert(long currentTimeMilli, AlertDefine define, String expr, String alarmKey) { + private void handleRecoveredAlert(long currentTimeMilli, AlertDefine define, String alarmKey) { Alert notResolvedAlert = notRecoveredAlertMap.remove(alarmKey); if (notResolvedAlert != null) { // Sending an alarm Restore Map tags = notResolvedAlert.getTags(); - String content = this.bundle.getString("alerter.alarm.recover") + " : " + expr; + String content = this.bundle.getString("alerter.alarm.recover") + " : " + notResolvedAlert.getContent(); Alert resumeAlert = Alert.builder() .tags(tags) .target(define.getApp() + "." + define.getMetric() + "." + define.getField())