@@ -175,9 +175,10 @@ private void createAlertingMonitorFromQueries(Pair<String, List<Pair<String, Rul
175175 detector .getAlertsIndex (),
176176 detector .getAlertsHistoryIndex (),
177177 detector .getAlertsHistoryIndexPattern (),
178- DetectorMonitorConfig .getRuleIndexMappingsByType (detector .getDetectorType ())));
178+ DetectorMonitorConfig .getRuleIndexMappingsByType (detector .getDetectorType ()),
179+ true ));
179180
180- IndexMonitorRequest indexMonitorRequest = new IndexMonitorRequest (Monitor .NO_ID , SequenceNumbers .UNASSIGNED_SEQ_NO , SequenceNumbers .UNASSIGNED_PRIMARY_TERM , refreshPolicy , RestRequest .Method .POST , monitor );
181+ IndexMonitorRequest indexMonitorRequest = new IndexMonitorRequest (Monitor .NO_ID , SequenceNumbers .UNASSIGNED_SEQ_NO , SequenceNumbers .UNASSIGNED_PRIMARY_TERM , refreshPolicy , RestRequest .Method .POST , monitor , null );
181182 AlertingPluginInterface .INSTANCE .indexMonitor ((NodeClient ) client , indexMonitorRequest , listener );
182183 }
183184
@@ -226,9 +227,10 @@ private void updateAlertingMonitorFromQueries(Pair<String, List<Pair<String, Rul
226227 detector .getAlertsIndex (),
227228 detector .getAlertsHistoryIndex (),
228229 detector .getAlertsHistoryIndexPattern (),
229- DetectorMonitorConfig .getRuleIndexMappingsByType (detector .getDetectorType ())));
230+ DetectorMonitorConfig .getRuleIndexMappingsByType (detector .getDetectorType ()),
231+ true ));
230232
231- IndexMonitorRequest indexMonitorRequest = new IndexMonitorRequest (detector .getMonitorIds ().get (0 ), SequenceNumbers .UNASSIGNED_SEQ_NO , SequenceNumbers .UNASSIGNED_PRIMARY_TERM , refreshPolicy , RestRequest .Method .PUT , monitor );
233+ IndexMonitorRequest indexMonitorRequest = new IndexMonitorRequest (detector .getMonitorIds ().get (0 ), SequenceNumbers .UNASSIGNED_SEQ_NO , SequenceNumbers .UNASSIGNED_PRIMARY_TERM , refreshPolicy , RestRequest .Method .PUT , monitor , null );
232234 AlertingPluginInterface .INSTANCE .indexMonitor ((NodeClient ) client , indexMonitorRequest , listener );
233235 }
234236
0 commit comments