Skip to content

Commit

Permalink
bugfix common alarm do not need monitorId tag existed (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsun28 authored Jul 19, 2023
1 parent 835b1d4 commit ab6a22f
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ public void reduceAndSendAlarm(Alert alert) {
Map<String, String> tags = alert.getTags();
String monitorIdStr = tags.get(CommonConstants.TAG_MONITOR_ID);
if (monitorIdStr == null) {
log.error("alert tags monitorId can not be null: {}.", alert);
return;
}
long monitorId = Long.parseLong(monitorIdStr);
List<Tag> tagList = alertMonitorDao.findMonitorIdBindTags(monitorId);
tagList.forEach(tag -> {
if (!tags.containsKey(tag.getName())) {
tags.put(tag.getName(), tag.getValue());
}
});
log.debug("receiver extern alarm message: {}", alert);
} else {
long monitorId = Long.parseLong(monitorIdStr);
List<Tag> tagList = alertMonitorDao.findMonitorIdBindTags(monitorId);
tagList.forEach(tag -> {
if (!tags.containsKey(tag.getName())) {
tags.put(tag.getName(), tag.getValue());
}
});
}
// converge -> silence
if (alarmConvergeReduce.filterConverge(alert) && alarmSilenceReduce.filterSilence(alert)) {
dataQueue.sendAlertsData(alert);
Expand Down

0 comments on commit ab6a22f

Please sign in to comment.