Browse Source

Capture when the alarm is abnormal

pull/3/MERGE
CalvinKirs 4 years ago
parent
commit
a3bbfdb652
  1. 9
      dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/runner/AlertSender.java

9
dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/runner/AlertSender.java

@ -157,7 +157,14 @@ public class AlertSender {
alertInfo.setAlertData(alertData);
Map<String, String> paramsMap = JSONUtils.toMap(instance.getPluginInstanceParams());
alertInfo.setAlertParams(paramsMap);
AlertResult alertResult = alertChannel.process(alertInfo);
AlertResult alertResult;
try {
alertResult = alertChannel.process(alertInfo);
} catch (Exception e) {
alertResult = new AlertResult("false", e.getMessage());
logger.error("send alert error alert data id :{},", alertData.getId(), e);
}
if (alertResult == null) {
String message = String.format("Alert Plugin %s send error : return alertResult value is null", pluginInstanceName);

Loading…
Cancel
Save