feat(告警模块): 其他类型的告警,每个场景联动产生一条告警记录。告警日志添加告警说明 (#441)
This commit is contained in:
parent
d9603381e0
commit
47975b0da2
|
|
@ -9,6 +9,7 @@ public interface AlarmConstants {
|
|||
String alarmName = "alarmName";
|
||||
String level = "level";
|
||||
String ownerId = "ownerId";
|
||||
String description = "description";
|
||||
String state = "state";
|
||||
String alarmTime = "alarmTime";
|
||||
String lastAlarmTime = "lastAlarmTime";
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ public interface AlarmRuleHandler {
|
|||
@Schema(description = "告警名称")
|
||||
private String alarmName;
|
||||
|
||||
@Schema(description = "告警说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "是否重复告警")
|
||||
private boolean alarming;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ public class DefaultAlarmRuleHandler implements AlarmRuleHandler, CommandLineRun
|
|||
AlarmConstants.ConfigKey.level,
|
||||
AlarmConstants.ConfigKey.targetType,
|
||||
AlarmConstants.ConfigKey.state,
|
||||
AlarmConstants.ConfigKey.ownerId
|
||||
AlarmConstants.ConfigKey.ownerId,
|
||||
AlarmConstants.ConfigKey.description
|
||||
));
|
||||
|
||||
private final Map<Tuple2<String, Integer>, Set<String>> ruleAlarmBinds = new ConcurrentHashMap<>();
|
||||
|
|
@ -159,6 +160,7 @@ public class DefaultAlarmRuleHandler implements AlarmRuleHandler, CommandLineRun
|
|||
entity.setSourceId(result.getSourceId());
|
||||
|
||||
entity.setAlarmName(result.getAlarmName());
|
||||
entity.setDescription(result.getDescription());
|
||||
entity.generateId();
|
||||
return entity;
|
||||
}
|
||||
|
|
@ -280,6 +282,7 @@ public class DefaultAlarmRuleHandler implements AlarmRuleHandler, CommandLineRun
|
|||
info.setId(IDGenerator.RANDOM.generate());
|
||||
info.setAlarmConfigId(record.getAlarmConfigId());
|
||||
info.setAlarmConfigName(record.getAlarmName());
|
||||
info.setDescription(record.getDescription());
|
||||
info.setAlarmRecordId(record.getId());
|
||||
info.setLevel(record.getLevel());
|
||||
info.setAlarmTime(record.getAlarmTime());
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class OtherAlarmTarget implements AlarmTarget {
|
|||
@Override
|
||||
public Flux<AlarmTargetInfo> convert(AlarmData data) {
|
||||
return Flux.just(AlarmTargetInfo
|
||||
.of(data.getAlarmConfigId(),
|
||||
.of(data.getRuleId(),
|
||||
data.getRuleName(),
|
||||
getType()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ public class AlarmConfigEntity extends GenericEntity<String> implements RecordCr
|
|||
configs.put(AlarmConstants.ConfigKey.ownerId, getModifierId() == null ? getCreatorId() : getModifierId());
|
||||
configs.put(AlarmConstants.ConfigKey.targetType, getTargetType());
|
||||
configs.put(AlarmConstants.ConfigKey.state, getState().name());
|
||||
|
||||
configs.put(AlarmConstants.ConfigKey.description, getDescription());
|
||||
return configs;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue