File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
alerting/src/main/kotlin/org/opensearch/alerting/remote/monitors
sample-remote-monitor-plugin
spi/src/main/kotlin/org/opensearch/alerting/spi Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ import org.opensearch.cluster.routing.ShardRouting
18
18
import org.opensearch.cluster.service.ClusterService
19
19
import org.opensearch.commons.alerting.action.DocLevelMonitorFanOutResponse
20
20
import org.opensearch.commons.alerting.model.ActionRunResult
21
- import org.opensearch.commons.alerting.model.DocLevelMonitorInput
22
21
import org.opensearch.commons.alerting.model.DocumentLevelTriggerRunResult
23
22
import org.opensearch.commons.alerting.model.InputRunResults
24
23
import org.opensearch.commons.alerting.model.Monitor
@@ -53,7 +52,7 @@ class RemoteDocumentLevelMonitorRunner : MonitorRunner() {
53
52
try {
54
53
validate(monitor)
55
54
} catch (e: Exception ) {
56
- logger.error(" Failed to start Document-level-monitor. Error: ${e.message} " )
55
+ logger.error(" Failed to start Document-level-monitor. Error: $e " )
57
56
monitorResult = monitorResult.copy(error = AlertingException .wrap(e))
58
57
}
59
58
@@ -199,11 +198,11 @@ class RemoteDocumentLevelMonitorRunner : MonitorRunner() {
199
198
throw IOException (" Only one input is supported with remote document-level-monitor." )
200
199
}
201
200
202
- if (monitor.inputs[0 ].name() != DocLevelMonitorInput . DOC_LEVEL_INPUT_FIELD ) {
201
+ if (monitor.inputs[0 ].name() != RemoteDocLevelMonitorInput . REMOTE_DOC_LEVEL_MONITOR_INPUT_FIELD ) {
203
202
throw IOException (" Invalid input with remote document-level-monitor." )
204
203
}
205
204
206
- if ((monitor.inputs[0 ] as DocLevelMonitorInput ) .indices.isEmpty()) {
205
+ if ((monitor.inputs[0 ] as RemoteDocLevelMonitorInput ).docLevelMonitorInput .indices.isEmpty()) {
207
206
throw IllegalArgumentException (" DocLevelMonitorInput has no indices" )
208
207
}
209
208
}
Original file line number Diff line number Diff line change @@ -44,8 +44,6 @@ dependencies {
44
44
compileOnly " org.jetbrains.kotlin:kotlin-stdlib:${ kotlin_version} "
45
45
compileOnly ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1'
46
46
compileOnly " org.jetbrains.kotlin:kotlin-stdlib-jdk8:${ kotlin_version} "
47
- // Needed for integ tests
48
- zipArchive group : ' org.opensearch.plugin' , name :' alerting' , version : " ${ opensearch_build} "
49
47
}
50
48
51
49
def es_tmp_dir = rootProject. file(' build/private/es_tmp' ). absoluteFile
Original file line number Diff line number Diff line change @@ -12,7 +12,12 @@ import org.opensearch.cluster.service.ClusterService
12
12
import org.opensearch.commons.alerting.action.DocLevelMonitorFanOutAction
13
13
import org.opensearch.commons.alerting.action.DocLevelMonitorFanOutRequest
14
14
import org.opensearch.commons.alerting.action.DocLevelMonitorFanOutResponse
15
- import org.opensearch.commons.alerting.model.*
15
+ import org.opensearch.commons.alerting.model.IndexExecutionContext
16
+ import org.opensearch.commons.alerting.model.Monitor
17
+ import org.opensearch.commons.alerting.model.MonitorMetadata
18
+ import org.opensearch.commons.alerting.model.MonitorRunResult
19
+ import org.opensearch.commons.alerting.model.TriggerRunResult
20
+ import org.opensearch.commons.alerting.model.WorkflowRunContext
16
21
import org.opensearch.commons.alerting.util.AlertingException
17
22
import org.opensearch.core.action.ActionListener
18
23
import org.opensearch.core.common.breaker.CircuitBreakingException
@@ -85,7 +90,16 @@ open class RemoteMonitorRunner {
85
90
dryrun,
86
91
monitorMetadata,
87
92
executionId,
88
- indexExecutionContext = null ,
93
+ indexExecutionContext = IndexExecutionContext (
94
+ listOf (),
95
+ mutableMapOf (),
96
+ mutableMapOf (),
97
+ " " ,
98
+ " " ,
99
+ listOf (),
100
+ listOf (),
101
+ listOf ()
102
+ ),
89
103
nodeShardAssignments[node.key]!! .toList(),
90
104
concreteIndices,
91
105
workflowRunContext
You can’t perform that action at this time.
0 commit comments