Skip to content

Commit d3ede1a

Browse files
eirsepjowg-amazon
andauthored
bacport PRs #1445, #1430, #1441, #1435 to 2.x (#1452)
* Add jvm aware setting and max num docs settings for batching docs for percolate queries (#1435) * add jvm aware and max docs settings for batching docs for percolate queries Signed-off-by: Surya Sashank Nistala <[email protected]> * fix stats logging Signed-off-by: Surya Sashank Nistala <[email protected]> * add queryfieldnames field in findings mapping Signed-off-by: Surya Sashank Nistala <[email protected]> --------- Signed-off-by: Surya Sashank Nistala <[email protected]> * optimize to fetch only fields relevant to doc level queries in doc level monitor instead of entire _source for each doc (#1441) * optimize to fetch only fields relevant to doc level queries in doc level monitor Signed-off-by: Surya Sashank Nistala <[email protected]> * fix test for settings check Signed-off-by: Surya Sashank Nistala <[email protected]> * fix ktlint Signed-off-by: Surya Sashank Nistala <[email protected]> --------- Signed-off-by: Surya Sashank Nistala <[email protected]> * clean up doc level queries on dry run (#1430) Signed-off-by: Joanne Wang <[email protected]> * optimize sequence number calculation and reduce search requests in doc level monitor execution (#1445) * optimize sequence number calculation and reduce search requests by n where n is number of shards being queried in the executino Signed-off-by: Surya Sashank Nistala <[email protected]> * fix tests Signed-off-by: Surya Sashank Nistala <[email protected]> * optimize check indices and execute to query only write index of aliases and datastreams during monitor creation Signed-off-by: Surya Sashank Nistala <[email protected]> * fix test Signed-off-by: Surya Sashank Nistala <[email protected]> * add javadoc Signed-off-by: Surya Sashank Nistala <[email protected]> * add tests to verify seq_no calculation Signed-off-by: Surya Sashank Nistala <[email protected]> --------- Signed-off-by: Surya Sashank Nistala <[email protected]> --------- Signed-off-by: Surya Sashank Nistala <[email protected]> Signed-off-by: Joanne Wang <[email protected]> Co-authored-by: Joanne Wang <[email protected]>
1 parent d1027da commit d3ede1a

File tree

13 files changed

+1063
-160
lines changed

13 files changed

+1063
-160
lines changed

alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import org.opensearch.alerting.resthandler.RestSearchMonitorAction
4646
import org.opensearch.alerting.script.TriggerScript
4747
import org.opensearch.alerting.service.DeleteMonitorService
4848
import org.opensearch.alerting.settings.AlertingSettings
49+
import org.opensearch.alerting.settings.AlertingSettings.Companion.DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE
4950
import org.opensearch.alerting.settings.DestinationSettings
5051
import org.opensearch.alerting.settings.LegacyOpenDistroAlertingSettings
5152
import org.opensearch.alerting.settings.LegacyOpenDistroDestinationSettings
@@ -100,6 +101,7 @@ import org.opensearch.core.xcontent.XContentParser
100101
import org.opensearch.env.Environment
101102
import org.opensearch.env.NodeEnvironment
102103
import org.opensearch.index.IndexModule
104+
import org.opensearch.monitor.jvm.JvmStats
103105
import org.opensearch.painless.spi.PainlessExtension
104106
import org.opensearch.painless.spi.Whitelist
105107
import org.opensearch.painless.spi.WhitelistLoader
@@ -272,6 +274,7 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
272274
.registerTriggerService(TriggerService(scriptService))
273275
.registerAlertService(AlertService(client, xContentRegistry, alertIndices))
274276
.registerDocLevelMonitorQueries(DocLevelMonitorQueries(client, clusterService))
277+
.registerJvmStats(JvmStats.jvmStats())
275278
.registerWorkflowService(WorkflowService(client, xContentRegistry))
276279
.registerConsumers()
277280
.registerDestinationSettings()
@@ -329,6 +332,9 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
329332
AlertingSettings.ALERT_HISTORY_MAX_DOCS,
330333
AlertingSettings.ALERT_HISTORY_RETENTION_PERIOD,
331334
AlertingSettings.ALERTING_MAX_MONITORS,
335+
AlertingSettings.PERCOLATE_QUERY_DOCS_SIZE_MEMORY_PERCENTAGE_LIMIT,
336+
DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE,
337+
AlertingSettings.PERCOLATE_QUERY_MAX_NUM_DOCS_IN_MEMORY,
332338
AlertingSettings.REQUEST_TIMEOUT,
333339
AlertingSettings.MAX_ACTION_THROTTLE_VALUE,
334340
AlertingSettings.FILTER_BY_BACKEND_ROLES,
@@ -349,6 +355,7 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
349355
LegacyOpenDistroAlertingSettings.REQUEST_TIMEOUT,
350356
LegacyOpenDistroAlertingSettings.MAX_ACTION_THROTTLE_VALUE,
351357
LegacyOpenDistroAlertingSettings.FILTER_BY_BACKEND_ROLES,
358+
AlertingSettings.DOC_LEVEL_MONITOR_FETCH_ONLY_QUERY_FIELDS_ENABLED,
352359
DestinationSettings.EMAIL_USERNAME,
353360
DestinationSettings.EMAIL_PASSWORD,
354361
DestinationSettings.ALLOW_LIST,

alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt

Lines changed: 351 additions & 134 deletions
Large diffs are not rendered by default.

alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerExecutionContext.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import org.opensearch.cluster.service.ClusterService
1818
import org.opensearch.common.settings.Settings
1919
import org.opensearch.common.unit.TimeValue
2020
import org.opensearch.core.xcontent.NamedXContentRegistry
21+
import org.opensearch.monitor.jvm.JvmStats
2122
import org.opensearch.script.ScriptService
2223
import org.opensearch.threadpool.ThreadPool
2324

@@ -36,6 +37,7 @@ data class MonitorRunnerExecutionContext(
3637
var alertService: AlertService? = null,
3738
var docLevelMonitorQueries: DocLevelMonitorQueries? = null,
3839
var workflowService: WorkflowService? = null,
40+
var jvmStats: JvmStats? = null,
3941

4042
@Volatile var retryPolicy: BackoffPolicy? = null,
4143
@Volatile var moveAlertsRetryPolicy: BackoffPolicy? = null,
@@ -48,5 +50,11 @@ data class MonitorRunnerExecutionContext(
4850

4951
@Volatile var maxActionableAlertCount: Long = AlertingSettings.DEFAULT_MAX_ACTIONABLE_ALERT_COUNT,
5052
@Volatile var indexTimeout: TimeValue? = null,
51-
@Volatile var findingsIndexBatchSize: Int = AlertingSettings.DEFAULT_FINDINGS_INDEXING_BATCH_SIZE
53+
@Volatile var findingsIndexBatchSize: Int = AlertingSettings.DEFAULT_FINDINGS_INDEXING_BATCH_SIZE,
54+
@Volatile var fetchOnlyQueryFieldNames: Boolean = true,
55+
@Volatile var percQueryMaxNumDocsInMemory: Int = AlertingSettings.DEFAULT_PERCOLATE_QUERY_NUM_DOCS_IN_MEMORY,
56+
@Volatile var percQueryDocsSizeMemoryPercentageLimit: Int =
57+
AlertingSettings.DEFAULT_PERCOLATE_QUERY_DOCS_SIZE_MEMORY_PERCENTAGE_LIMIT,
58+
@Volatile var docLevelMonitorShardFetchSize: Int =
59+
AlertingSettings.DEFAULT_DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE,
5260
)

alerting/src/main/kotlin/org/opensearch/alerting/MonitorRunnerService.kt

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ import org.opensearch.alerting.script.TriggerExecutionContext
2525
import org.opensearch.alerting.settings.AlertingSettings
2626
import org.opensearch.alerting.settings.AlertingSettings.Companion.ALERT_BACKOFF_COUNT
2727
import org.opensearch.alerting.settings.AlertingSettings.Companion.ALERT_BACKOFF_MILLIS
28+
import org.opensearch.alerting.settings.AlertingSettings.Companion.DOC_LEVEL_MONITOR_FETCH_ONLY_QUERY_FIELDS_ENABLED
29+
import org.opensearch.alerting.settings.AlertingSettings.Companion.DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE
2830
import org.opensearch.alerting.settings.AlertingSettings.Companion.FINDINGS_INDEXING_BATCH_SIZE
2931
import org.opensearch.alerting.settings.AlertingSettings.Companion.INDEX_TIMEOUT
3032
import org.opensearch.alerting.settings.AlertingSettings.Companion.MAX_ACTIONABLE_ALERT_COUNT
3133
import org.opensearch.alerting.settings.AlertingSettings.Companion.MOVE_ALERTS_BACKOFF_COUNT
3234
import org.opensearch.alerting.settings.AlertingSettings.Companion.MOVE_ALERTS_BACKOFF_MILLIS
35+
import org.opensearch.alerting.settings.AlertingSettings.Companion.PERCOLATE_QUERY_DOCS_SIZE_MEMORY_PERCENTAGE_LIMIT
36+
import org.opensearch.alerting.settings.AlertingSettings.Companion.PERCOLATE_QUERY_MAX_NUM_DOCS_IN_MEMORY
3337
import org.opensearch.alerting.settings.DestinationSettings.Companion.ALLOW_LIST
3438
import org.opensearch.alerting.settings.DestinationSettings.Companion.HOST_DENY_LIST
3539
import org.opensearch.alerting.settings.DestinationSettings.Companion.loadDestinationSettings
@@ -50,6 +54,7 @@ import org.opensearch.commons.alerting.model.action.Action
5054
import org.opensearch.commons.alerting.util.isBucketLevelMonitor
5155
import org.opensearch.core.action.ActionListener
5256
import org.opensearch.core.xcontent.NamedXContentRegistry
57+
import org.opensearch.monitor.jvm.JvmStats
5358
import org.opensearch.script.Script
5459
import org.opensearch.script.ScriptService
5560
import org.opensearch.script.TemplateScript
@@ -134,6 +139,11 @@ object MonitorRunnerService : JobRunner, CoroutineScope, AbstractLifecycleCompon
134139
return this
135140
}
136141

142+
fun registerJvmStats(jvmStats: JvmStats): MonitorRunnerService {
143+
this.monitorCtx.jvmStats = jvmStats
144+
return this
145+
}
146+
137147
// Must be called after registerClusterService and registerSettings in AlertingPlugin
138148
fun registerConsumers(): MonitorRunnerService {
139149
monitorCtx.retryPolicy = BackoffPolicy.constantBackoff(
@@ -176,6 +186,30 @@ object MonitorRunnerService : JobRunner, CoroutineScope, AbstractLifecycleCompon
176186
monitorCtx.findingsIndexBatchSize = it
177187
}
178188

189+
monitorCtx.fetchOnlyQueryFieldNames = DOC_LEVEL_MONITOR_FETCH_ONLY_QUERY_FIELDS_ENABLED.get(monitorCtx.settings)
190+
monitorCtx.clusterService!!.clusterSettings.addSettingsUpdateConsumer(DOC_LEVEL_MONITOR_FETCH_ONLY_QUERY_FIELDS_ENABLED) {
191+
monitorCtx.fetchOnlyQueryFieldNames = it
192+
}
193+
194+
monitorCtx.percQueryMaxNumDocsInMemory = PERCOLATE_QUERY_MAX_NUM_DOCS_IN_MEMORY.get(monitorCtx.settings)
195+
monitorCtx.clusterService!!.clusterSettings.addSettingsUpdateConsumer(PERCOLATE_QUERY_MAX_NUM_DOCS_IN_MEMORY) {
196+
monitorCtx.percQueryMaxNumDocsInMemory = it
197+
}
198+
199+
monitorCtx.percQueryDocsSizeMemoryPercentageLimit =
200+
PERCOLATE_QUERY_DOCS_SIZE_MEMORY_PERCENTAGE_LIMIT.get(monitorCtx.settings)
201+
monitorCtx.clusterService!!.clusterSettings
202+
.addSettingsUpdateConsumer(PERCOLATE_QUERY_DOCS_SIZE_MEMORY_PERCENTAGE_LIMIT) {
203+
monitorCtx.percQueryDocsSizeMemoryPercentageLimit = it
204+
}
205+
206+
monitorCtx.docLevelMonitorShardFetchSize =
207+
DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE.get(monitorCtx.settings)
208+
monitorCtx.clusterService!!.clusterSettings
209+
.addSettingsUpdateConsumer(DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE) {
210+
monitorCtx.docLevelMonitorShardFetchSize = it
211+
}
212+
179213
return this
180214
}
181215

@@ -258,11 +292,19 @@ object MonitorRunnerService : JobRunner, CoroutineScope, AbstractLifecycleCompon
258292
when (job) {
259293
is Workflow -> {
260294
launch {
295+
logger.debug(
296+
"PERF_DEBUG: executing workflow ${job.id} on node " +
297+
monitorCtx.clusterService!!.state().nodes().localNode.id
298+
)
261299
runJob(job, periodStart, periodEnd, false)
262300
}
263301
}
264302
is Monitor -> {
265303
launch {
304+
logger.debug(
305+
"PERF_DEBUG: executing ${job.monitorType} ${job.id} on node " +
306+
monitorCtx.clusterService!!.state().nodes().localNode.id
307+
)
266308
runJob(job, periodStart, periodEnd, false)
267309
}
268310
}
@@ -307,7 +349,7 @@ object MonitorRunnerService : JobRunner, CoroutineScope, AbstractLifecycleCompon
307349
val runResult = if (monitor.isBucketLevelMonitor()) {
308350
BucketLevelMonitorRunner.runMonitor(monitor, monitorCtx, periodStart, periodEnd, dryrun, executionId = executionId)
309351
} else if (monitor.isDocLevelMonitor()) {
310-
DocumentLevelMonitorRunner.runMonitor(monitor, monitorCtx, periodStart, periodEnd, dryrun, executionId = executionId)
352+
DocumentLevelMonitorRunner().runMonitor(monitor, monitorCtx, periodStart, periodEnd, dryrun, executionId = executionId)
311353
} else {
312354
QueryLevelMonitorRunner.runMonitor(monitor, monitorCtx, periodStart, periodEnd, dryrun, executionId = executionId)
313355
}

alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentExecutionContext.kt

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package org.opensearch.alerting.model
7+
8+
import org.opensearch.commons.alerting.model.DocLevelQuery
9+
10+
/** DTO that contains all the necessary context for fetching data from shard and performing percolate queries */
11+
data class IndexExecutionContext(
12+
val queries: List<DocLevelQuery>,
13+
val lastRunContext: MutableMap<String, Any>,
14+
val updatedLastRunContext: MutableMap<String, Any>,
15+
val indexName: String,
16+
val concreteIndexName: String,
17+
val conflictingFields: List<String>,
18+
val docIds: List<String>? = null,
19+
)

alerting/src/main/kotlin/org/opensearch/alerting/settings/AlertingSettings.kt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,59 @@ class AlertingSettings {
1818
companion object {
1919
const val DEFAULT_MAX_ACTIONABLE_ALERT_COUNT = 50L
2020
const val DEFAULT_FINDINGS_INDEXING_BATCH_SIZE = 1000
21+
const val DEFAULT_PERCOLATE_QUERY_NUM_DOCS_IN_MEMORY = 50000
22+
const val DEFAULT_PERCOLATE_QUERY_DOCS_SIZE_MEMORY_PERCENTAGE_LIMIT = 10
23+
const val DEFAULT_DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE = 10000
2124

2225
val ALERTING_MAX_MONITORS = Setting.intSetting(
2326
"plugins.alerting.monitor.max_monitors",
2427
LegacyOpenDistroAlertingSettings.ALERTING_MAX_MONITORS,
2528
Setting.Property.NodeScope, Setting.Property.Dynamic
2629
)
2730

31+
/** Defines the threshold percentage of heap size in bytes till which we accumulate docs in memory before we query against percolate query
32+
* index in document level monitor execution.
33+
*/
34+
val PERCOLATE_QUERY_DOCS_SIZE_MEMORY_PERCENTAGE_LIMIT = Setting.intSetting(
35+
"plugins.alerting.monitor.percolate_query_docs_size_memory_percentage_limit",
36+
10,
37+
0,
38+
100,
39+
Setting.Property.NodeScope, Setting.Property.Dynamic
40+
)
41+
42+
/** Purely a setting used to verify seq_no calculation
43+
*/
44+
val DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE = Setting.intSetting(
45+
"plugins.alerting.monitor.doc_level_monitor_shard_fetch_size",
46+
DEFAULT_DOC_LEVEL_MONITOR_SHARD_FETCH_SIZE,
47+
1,
48+
10000,
49+
Setting.Property.NodeScope, Setting.Property.Dynamic
50+
)
51+
52+
/** Defines the threshold of the maximum number of docs accumulated in memory to query against percolate query index in document
53+
* level monitor execution. The docs are being collected from searching on shards of indices mentioned in the
54+
* monitor input indices field. When the number of in-memory docs reaches or exceeds threshold we immediately perform percolate
55+
* query with the current set of docs and clear the cache and repeat the process till we have queried all indices in current
56+
* execution
57+
*/
58+
val PERCOLATE_QUERY_MAX_NUM_DOCS_IN_MEMORY = Setting.intSetting(
59+
"plugins.alerting.monitor.percolate_query_max_num_docs_in_memory",
60+
DEFAULT_PERCOLATE_QUERY_NUM_DOCS_IN_MEMORY, 1000,
61+
Setting.Property.NodeScope, Setting.Property.Dynamic
62+
)
63+
64+
/**
65+
* Boolean setting to enable/disable optimizing doc level monitors by fetchign only fields mentioned in queries.
66+
* Enabled by default. If disabled, will fetch entire source of documents while fetch data from shards.
67+
*/
68+
val DOC_LEVEL_MONITOR_FETCH_ONLY_QUERY_FIELDS_ENABLED = Setting.boolSetting(
69+
"plugins.alerting.monitor.doc_level_monitor_query_field_names_enabled",
70+
true,
71+
Setting.Property.NodeScope, Setting.Property.Dynamic
72+
)
73+
2874
val INPUT_TIMEOUT = Setting.positiveTimeSetting(
2975
"plugins.alerting.input_timeout",
3076
LegacyOpenDistroAlertingSettings.INPUT_TIMEOUT,

alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,15 @@ class TransportIndexMonitorAction @Inject constructor(
198198
else (it as DocLevelMonitorInput).indices
199199
indices.addAll(inputIndices)
200200
}
201-
val searchRequest = SearchRequest().indices(*indices.toTypedArray())
201+
val updatedIndices = indices.map { index ->
202+
if (IndexUtils.isAlias(index, clusterService.state()) || IndexUtils.isDataStream(index, clusterService.state())) {
203+
val metadata = clusterService.state().metadata.indicesLookup[index]?.writeIndex
204+
metadata?.index?.name ?: index
205+
} else {
206+
index
207+
}
208+
}
209+
val searchRequest = SearchRequest().indices(*updatedIndices.toTypedArray())
202210
.source(SearchSourceBuilder.searchSource().size(1).query(QueryBuilders.matchAllQuery()))
203211
client.search(
204212
searchRequest,

alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import org.opensearch.action.admin.indices.alias.Alias
1313
import org.opensearch.action.admin.indices.create.CreateIndexRequest
1414
import org.opensearch.action.admin.indices.create.CreateIndexResponse
1515
import org.opensearch.action.admin.indices.delete.DeleteIndexRequest
16+
import org.opensearch.action.admin.indices.exists.indices.IndicesExistsRequest
17+
import org.opensearch.action.admin.indices.exists.indices.IndicesExistsResponse
1618
import org.opensearch.action.admin.indices.mapping.put.PutMappingRequest
1719
import org.opensearch.action.admin.indices.rollover.RolloverRequest
1820
import org.opensearch.action.admin.indices.rollover.RolloverResponse
@@ -38,8 +40,16 @@ import org.opensearch.commons.alerting.model.DocLevelMonitorInput
3840
import org.opensearch.commons.alerting.model.DocLevelQuery
3941
import org.opensearch.commons.alerting.model.Monitor
4042
import org.opensearch.commons.alerting.model.ScheduledJob
43+
import org.opensearch.core.action.ActionListener
4144
import org.opensearch.core.rest.RestStatus
4245
import org.opensearch.index.mapper.MapperService.INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING
46+
import org.opensearch.index.query.QueryBuilders
47+
import org.opensearch.index.reindex.BulkByScrollResponse
48+
import org.opensearch.index.reindex.DeleteByQueryAction
49+
import org.opensearch.index.reindex.DeleteByQueryRequestBuilder
50+
import kotlin.coroutines.resume
51+
import kotlin.coroutines.resumeWithException
52+
import kotlin.coroutines.suspendCoroutine
4353

4454
private val log = LogManager.getLogger(DocLevelMonitorQueries::class.java)
4555

@@ -134,6 +144,42 @@ class DocLevelMonitorQueries(private val client: Client, private val clusterServ
134144
return true
135145
}
136146

147+
suspend fun deleteDocLevelQueriesOnDryRun(monitorMetadata: MonitorMetadata) {
148+
try {
149+
monitorMetadata.sourceToQueryIndexMapping.forEach { (_, queryIndex) ->
150+
val indicesExistsResponse: IndicesExistsResponse =
151+
client.suspendUntil {
152+
client.admin().indices().exists(IndicesExistsRequest(queryIndex), it)
153+
}
154+
if (indicesExistsResponse.isExists == false) {
155+
return
156+
}
157+
158+
val queryBuilder = QueryBuilders.boolQuery()
159+
.must(QueryBuilders.existsQuery("monitor_id"))
160+
.mustNot(QueryBuilders.wildcardQuery("monitor_id", "*"))
161+
162+
val response: BulkByScrollResponse = suspendCoroutine { cont ->
163+
DeleteByQueryRequestBuilder(client, DeleteByQueryAction.INSTANCE)
164+
.source(queryIndex)
165+
.filter(queryBuilder)
166+
.refresh(true)
167+
.execute(
168+
object : ActionListener<BulkByScrollResponse> {
169+
override fun onResponse(response: BulkByScrollResponse) = cont.resume(response)
170+
override fun onFailure(t: Exception) = cont.resumeWithException(t)
171+
}
172+
)
173+
}
174+
response.bulkFailures.forEach {
175+
log.error("Failed deleting queries while removing dry run queries: [${it.id}] cause: [${it.cause}] ")
176+
}
177+
}
178+
} catch (e: Exception) {
179+
log.error("Failed to delete doc level queries on dry run", e)
180+
}
181+
}
182+
137183
fun docLevelQueryIndexExists(dataSources: DataSources): Boolean {
138184
val clusterState = clusterService.state()
139185
return clusterState.metadata.hasAlias(dataSources.queryIndex)

alerting/src/main/kotlin/org/opensearch/alerting/workflow/CompositeWorkflowRunner.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ object CompositeWorkflowRunner : WorkflowRunner() {
255255
executionId
256256
)
257257
} else if (delegateMonitor.isDocLevelMonitor()) {
258-
return DocumentLevelMonitorRunner.runMonitor(
258+
return DocumentLevelMonitorRunner().runMonitor(
259259
delegateMonitor,
260260
monitorCtx,
261261
periodStart,

alerting/src/main/resources/org/opensearch/alerting/alerts/finding_mapping.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
},
5050
"fields": {
5151
"type": "text"
52+
},
53+
"query_field_names": {
54+
"type": "keyword"
5255
}
5356
}
5457
},

0 commit comments

Comments
 (0)