未验证 提交 88ec7077 编写于 作者: sinat_25235033's avatar sinat_25235033 提交者: GitHub

bugfix common alarm do not need monitorId tag existed (#1108)

上级 da8d5049
......@@ -35,16 +35,16 @@ public class AlarmCommonReduce {
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册