@@ -21,6 +21,7 @@ import org.opensearch.alerting.core.JobSweeper
21
21
import org.opensearch.alerting.core.ScheduledJobIndices
22
22
import org.opensearch.alerting.core.action.node.ScheduledJobsStatsAction
23
23
import org.opensearch.alerting.core.action.node.ScheduledJobsStatsTransportAction
24
+ import org.opensearch.alerting.core.lock.LockService
24
25
import org.opensearch.alerting.core.resthandler.RestScheduledJobStatsHandler
25
26
import org.opensearch.alerting.core.schedule.JobScheduler
26
27
import org.opensearch.alerting.core.settings.LegacyOpenDistroScheduledJobSettings
@@ -47,6 +48,7 @@ import org.opensearch.alerting.resthandler.RestSearchMonitorAction
47
48
import org.opensearch.alerting.script.TriggerScript
48
49
import org.opensearch.alerting.service.DeleteMonitorService
49
50
import org.opensearch.alerting.settings.AlertingSettings
51
+ import org.opensearch.alerting.settings.AlertingSettings.Companion.DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE
50
52
import org.opensearch.alerting.settings.DestinationSettings
51
53
import org.opensearch.alerting.settings.LegacyOpenDistroAlertingSettings
52
54
import org.opensearch.alerting.settings.LegacyOpenDistroDestinationSettings
@@ -99,6 +101,7 @@ import org.opensearch.core.xcontent.XContentParser
99
101
import org.opensearch.env.Environment
100
102
import org.opensearch.env.NodeEnvironment
101
103
import org.opensearch.index.IndexModule
104
+ import org.opensearch.monitor.jvm.JvmStats
102
105
import org.opensearch.painless.spi.PainlessExtension
103
106
import org.opensearch.painless.spi.Whitelist
104
107
import org.opensearch.painless.spi.WhitelistLoader
@@ -254,6 +257,7 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
254
257
): Collection <Any > {
255
258
// Need to figure out how to use the OpenSearch DI classes rather than handwiring things here.
256
259
val settings = environment.settings()
260
+ val lockService = LockService (client, clusterService)
257
261
alertIndices = AlertIndices (settings, client, threadPool, clusterService)
258
262
runner = MonitorRunnerService
259
263
.registerClusterService(clusterService)
@@ -268,7 +272,9 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
268
272
.registerTriggerService(TriggerService (scriptService))
269
273
.registerAlertService(AlertService (client, xContentRegistry, alertIndices))
270
274
.registerDocLevelMonitorQueries(DocLevelMonitorQueries (client, clusterService))
275
+ .registerJvmStats(JvmStats .jvmStats())
271
276
.registerWorkflowService(WorkflowService (client, xContentRegistry))
277
+ .registerLockService(lockService)
272
278
.registerConsumers()
273
279
.registerDestinationSettings()
274
280
scheduledJobIndices = ScheduledJobIndices (client.admin(), clusterService)
@@ -293,9 +299,9 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
293
299
settings
294
300
)
295
301
296
- DeleteMonitorService .initialize(client)
302
+ DeleteMonitorService .initialize(client, lockService )
297
303
298
- return listOf (sweeper, scheduler, runner, scheduledJobIndices, docLevelMonitorQueries, destinationMigrationCoordinator)
304
+ return listOf (sweeper, scheduler, runner, scheduledJobIndices, docLevelMonitorQueries, destinationMigrationCoordinator, lockService )
299
305
}
300
306
301
307
override fun getSettings (): List <Setting <* >> {
@@ -325,6 +331,9 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
325
331
AlertingSettings .ALERT_HISTORY_MAX_DOCS ,
326
332
AlertingSettings .ALERT_HISTORY_RETENTION_PERIOD ,
327
333
AlertingSettings .ALERTING_MAX_MONITORS ,
334
+ AlertingSettings .PERCOLATE_QUERY_DOCS_SIZE_MEMORY_PERCENTAGE_LIMIT ,
335
+ DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE ,
336
+ AlertingSettings .PERCOLATE_QUERY_MAX_NUM_DOCS_IN_MEMORY ,
328
337
AlertingSettings .REQUEST_TIMEOUT ,
329
338
AlertingSettings .MAX_ACTION_THROTTLE_VALUE ,
330
339
AlertingSettings .FILTER_BY_BACKEND_ROLES ,
@@ -345,6 +354,7 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
345
354
LegacyOpenDistroAlertingSettings .REQUEST_TIMEOUT ,
346
355
LegacyOpenDistroAlertingSettings .MAX_ACTION_THROTTLE_VALUE ,
347
356
LegacyOpenDistroAlertingSettings .FILTER_BY_BACKEND_ROLES ,
357
+ AlertingSettings .DOC_LEVEL_MONITOR_FETCH_ONLY_QUERY_FIELDS_ENABLED ,
348
358
DestinationSettings .EMAIL_USERNAME ,
349
359
DestinationSettings .EMAIL_PASSWORD ,
350
360
DestinationSettings .ALLOW_LIST ,
@@ -357,7 +367,8 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
357
367
AlertingSettings .FINDING_HISTORY_MAX_DOCS ,
358
368
AlertingSettings .FINDING_HISTORY_INDEX_MAX_AGE ,
359
369
AlertingSettings .FINDING_HISTORY_ROLLOVER_PERIOD ,
360
- AlertingSettings .FINDING_HISTORY_RETENTION_PERIOD
370
+ AlertingSettings .FINDING_HISTORY_RETENTION_PERIOD ,
371
+ AlertingSettings .FINDINGS_INDEXING_BATCH_SIZE
361
372
)
362
373
}
363
374
0 commit comments