Skip to content

Commit c39caca

Browse files
[3.5] Remove PPL alerting feature. (opensearch-project#2017)
* [AUTO] Add release notes for 3.5.0 (opensearch-project#2014) * Add release notes for 3.5.0 Signed-off-by: opensearch-ci <opensearch-infra@amazon.com> * Add release notes for 3.5.0 Signed-off-by: opensearch-ci <opensearch-infra@amazon.com> --------- Signed-off-by: opensearch-ci <opensearch-infra@amazon.com> Signed-off-by: Thomas Hurney <hurneyt@amazon.com> * Revert "PPL Alerting: Execute Monitor and Monitor Stats (opensearch-project#1960)" This reverts commit 74aed08. Signed-off-by: Thomas Hurney <hurneyt@amazon.com> * Revert "PPL Alerting: Get Alerts and Alert Lifecycle (opensearch-project#1972)" This reverts commit d9614ba Signed-off-by: Thomas Hurney <hurneyt@amazon.com> * Revert "PPL Alerting: Delete Monitor, More V1/V2 Separation (opensearch-project#1968)" This reverts commit fd151de. Signed-off-by: Thomas Hurney <hurneyt@amazon.com> * Revert "PPL Alerting: Get and Search Monitors (opensearch-project#1966)" This reverts commit 819599f. Signed-off-by: Thomas Hurney <hurneyt@amazon.com> * Revert "PPL Alerting: Create and Update Monitor V2 (opensearch-project#1961)" This reverts commit c911cfa Signed-off-by: Thomas Hurney <hurneyt@amazon.com> * Revert "PPL Alerting: Models (opensearch-project#1955)" This reverts commit 497dea8. Signed-off-by: Thomas Hurney <hurneyt@amazon.com> * Fixed test role creation. Signed-off-by: Thomas Hurney <hurneyt@amazon.com> --------- Signed-off-by: opensearch-ci <opensearch-infra@amazon.com> Signed-off-by: Thomas Hurney <hurneyt@amazon.com> Co-authored-by: opensearch-ci <83309141+opensearch-ci-bot@users.noreply.github.com>
1 parent 29907a3 commit c39caca

103 files changed

Lines changed: 559 additions & 11748 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

alerting/build.gradle

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ dependencies {
151151
// Needed for integ tests
152152
zipArchive group: 'org.opensearch.plugin', name:'opensearch-notifications-core', version: "${opensearch_build}"
153153
zipArchive group: 'org.opensearch.plugin', name:'notifications', version: "${opensearch_build}"
154-
zipArchive group: 'org.opensearch.plugin', name:'opensearch-job-scheduler', version: "${opensearch_build}"
155-
zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${opensearch_build}"
156154

157155
// Needed for security tests
158156
if (securityEnabled) {
@@ -170,10 +168,7 @@ dependencies {
170168
implementation "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}"
171169
implementation "org.jetbrains:annotations:13.0"
172170

173-
// SQL/PPL plugin dependencies are included in alerting-core
174171
api project(":alerting-core")
175-
implementation 'org.json:json:20240303'
176-
177172
implementation "com.github.seancfoley:ipaddress:5.4.1"
178173
implementation project(path: ":alerting-spi", configuration: 'shadow')
179174

@@ -251,28 +246,6 @@ testClusters.integTest {
251246
}
252247
}))
253248

254-
plugin(provider({
255-
new RegularFile() {
256-
@Override
257-
File getAsFile() {
258-
return configurations.zipArchive.asFileTree.matching {
259-
include '**/opensearch-job-scheduler*'
260-
}.singleFile
261-
}
262-
}
263-
}))
264-
265-
plugin(provider({
266-
new RegularFile() {
267-
@Override
268-
File getAsFile() {
269-
return configurations.zipArchive.asFileTree.matching {
270-
include '**/opensearch-sql-plugin*'
271-
}.singleFile
272-
}
273-
}
274-
}))
275-
276249
if (securityEnabled) {
277250
plugin(provider({
278251
new RegularFile() {

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

Lines changed: 3 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,8 @@ import org.opensearch.alerting.action.GetEmailGroupAction
1414
import org.opensearch.alerting.action.GetRemoteIndexesAction
1515
import org.opensearch.alerting.action.SearchEmailAccountAction
1616
import org.opensearch.alerting.action.SearchEmailGroupAction
17-
import org.opensearch.alerting.actionv2.DeleteMonitorV2Action
18-
import org.opensearch.alerting.actionv2.ExecuteMonitorV2Action
19-
import org.opensearch.alerting.actionv2.GetAlertsV2Action
20-
import org.opensearch.alerting.actionv2.GetMonitorV2Action
21-
import org.opensearch.alerting.actionv2.IndexMonitorV2Action
22-
import org.opensearch.alerting.actionv2.SearchMonitorV2Action
2317
import org.opensearch.alerting.alerts.AlertIndices
2418
import org.opensearch.alerting.alerts.AlertIndices.Companion.ALL_ALERT_INDEX_PATTERN
25-
import org.opensearch.alerting.alertsv2.AlertV2Indices
26-
import org.opensearch.alerting.alertsv2.AlertV2Indices.Companion.ALL_ALERT_V2_INDEX_PATTERN
27-
import org.opensearch.alerting.alertsv2.AlertV2Mover
2819
import org.opensearch.alerting.comments.CommentsIndices
2920
import org.opensearch.alerting.comments.CommentsIndices.Companion.ALL_COMMENTS_INDEX_PATTERN
3021
import org.opensearch.alerting.core.JobSweeper
@@ -34,10 +25,8 @@ import org.opensearch.alerting.core.action.node.ScheduledJobsStatsTransportActio
3425
import org.opensearch.alerting.core.lock.LockService
3526
import org.opensearch.alerting.core.resthandler.RestScheduledJobStatsHandler
3627
import org.opensearch.alerting.core.schedule.JobScheduler
37-
import org.opensearch.alerting.core.settings.AlertingV2Settings
3828
import org.opensearch.alerting.core.settings.LegacyOpenDistroScheduledJobSettings
3929
import org.opensearch.alerting.core.settings.ScheduledJobSettings
40-
import org.opensearch.alerting.modelv2.MonitorV2
4130
import org.opensearch.alerting.remote.monitors.RemoteMonitorRegistry
4231
import org.opensearch.alerting.resthandler.RestAcknowledgeAlertAction
4332
import org.opensearch.alerting.resthandler.RestAcknowledgeChainedAlertAction
@@ -62,12 +51,6 @@ import org.opensearch.alerting.resthandler.RestSearchAlertingCommentAction
6251
import org.opensearch.alerting.resthandler.RestSearchEmailAccountAction
6352
import org.opensearch.alerting.resthandler.RestSearchEmailGroupAction
6453
import org.opensearch.alerting.resthandler.RestSearchMonitorAction
65-
import org.opensearch.alerting.resthandlerv2.RestDeleteMonitorV2Action
66-
import org.opensearch.alerting.resthandlerv2.RestExecuteMonitorV2Action
67-
import org.opensearch.alerting.resthandlerv2.RestGetAlertsV2Action
68-
import org.opensearch.alerting.resthandlerv2.RestGetMonitorV2Action
69-
import org.opensearch.alerting.resthandlerv2.RestIndexMonitorV2Action
70-
import org.opensearch.alerting.resthandlerv2.RestSearchMonitorV2Action
7154
import org.opensearch.alerting.script.TriggerScript
7255
import org.opensearch.alerting.service.DeleteMonitorService
7356
import org.opensearch.alerting.settings.AlertingSettings
@@ -100,12 +83,6 @@ import org.opensearch.alerting.transport.TransportSearchAlertingCommentAction
10083
import org.opensearch.alerting.transport.TransportSearchEmailAccountAction
10184
import org.opensearch.alerting.transport.TransportSearchEmailGroupAction
10285
import org.opensearch.alerting.transport.TransportSearchMonitorAction
103-
import org.opensearch.alerting.transportv2.TransportDeleteMonitorV2Action
104-
import org.opensearch.alerting.transportv2.TransportExecuteMonitorV2Action
105-
import org.opensearch.alerting.transportv2.TransportGetAlertsV2Action
106-
import org.opensearch.alerting.transportv2.TransportGetMonitorV2Action
107-
import org.opensearch.alerting.transportv2.TransportIndexMonitorV2Action
108-
import org.opensearch.alerting.transportv2.TransportSearchMonitorV2Action
10986
import org.opensearch.alerting.util.DocLevelMonitorQueries
11087
import org.opensearch.alerting.util.destinationmigration.DestinationMigrationCoordinator
11188
import org.opensearch.cluster.metadata.IndexNameExpressionResolver
@@ -180,7 +157,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
180157
@JvmField val OPEN_SEARCH_DASHBOARDS_USER_AGENT = "OpenSearch-Dashboards"
181158
@JvmField val UI_METADATA_EXCLUDE = arrayOf("monitor.${Monitor.UI_METADATA_FIELD}")
182159
@JvmField val MONITOR_BASE_URI = "/_plugins/_alerting/monitors"
183-
@JvmField val MONITOR_V2_BASE_URI = "/_plugins/_alerting/v2/monitors"
184160
@JvmField val WORKFLOW_BASE_URI = "/_plugins/_alerting/workflows"
185161
@JvmField val REMOTE_BASE_URI = "/_plugins/_alerting/remote"
186162
@JvmField val DESTINATION_BASE_URI = "/_plugins/_alerting/destinations"
@@ -193,7 +169,7 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
193169
@JvmField val FINDING_BASE_URI = "/_plugins/_alerting/findings"
194170
@JvmField val COMMENTS_BASE_URI = "/_plugins/_alerting/comments"
195171

196-
@JvmField val ALERTING_JOB_TYPES = listOf("monitor", "workflow", "monitor_v2")
172+
@JvmField val ALERTING_JOB_TYPES = listOf("monitor", "workflow")
197173
}
198174

199175
lateinit var runner: MonitorRunnerService
@@ -204,10 +180,8 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
204180
lateinit var docLevelMonitorQueries: DocLevelMonitorQueries
205181
lateinit var threadPool: ThreadPool
206182
lateinit var alertIndices: AlertIndices
207-
lateinit var alertV2Indices: AlertV2Indices
208183
lateinit var clusterService: ClusterService
209184
lateinit var destinationMigrationCoordinator: DestinationMigrationCoordinator
210-
lateinit var alertV2Mover: AlertV2Mover
211185
var monitorTypeToMonitorRunners: MutableMap<String, RemoteMonitorRegistry> = mutableMapOf()
212186

213187
override fun getRestHandlers(
@@ -220,7 +194,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
220194
nodesInCluster: Supplier<DiscoveryNodes>
221195
): List<RestHandler> {
222196
return listOf(
223-
// Alerting V1
224197
RestGetMonitorAction(),
225198
RestDeleteMonitorAction(),
226199
RestIndexMonitorAction(),
@@ -245,20 +218,11 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
245218
RestIndexAlertingCommentAction(),
246219
RestSearchAlertingCommentAction(),
247220
RestDeleteAlertingCommentAction(),
248-
249-
// Alerting V2
250-
RestIndexMonitorV2Action(),
251-
RestExecuteMonitorV2Action(),
252-
RestDeleteMonitorV2Action(),
253-
RestGetMonitorV2Action(),
254-
RestSearchMonitorV2Action(settings, clusterService),
255-
RestGetAlertsV2Action()
256221
)
257222
}
258223

259224
override fun getActions(): List<ActionPlugin.ActionHandler<out ActionRequest, out ActionResponse>> {
260225
return listOf(
261-
// Alerting V1
262226
ActionPlugin.ActionHandler(ScheduledJobsStatsAction.INSTANCE, ScheduledJobsStatsTransportAction::class.java),
263227
ActionPlugin.ActionHandler(AlertingActions.INDEX_MONITOR_ACTION_TYPE, TransportIndexMonitorAction::class.java),
264228
ActionPlugin.ActionHandler(AlertingActions.GET_MONITOR_ACTION_TYPE, TransportGetMonitorAction::class.java),
@@ -285,22 +249,13 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
285249
ActionPlugin.ActionHandler(AlertingActions.DELETE_COMMENT_ACTION_TYPE, TransportDeleteAlertingCommentAction::class.java),
286250
ActionPlugin.ActionHandler(ExecuteWorkflowAction.INSTANCE, TransportExecuteWorkflowAction::class.java),
287251
ActionPlugin.ActionHandler(GetRemoteIndexesAction.INSTANCE, TransportGetRemoteIndexesAction::class.java),
288-
ActionPlugin.ActionHandler(DocLevelMonitorFanOutAction.INSTANCE, TransportDocLevelMonitorFanOutAction::class.java),
289-
290-
// Alerting V2
291-
ActionPlugin.ActionHandler(IndexMonitorV2Action.INSTANCE, TransportIndexMonitorV2Action::class.java),
292-
ActionPlugin.ActionHandler(GetMonitorV2Action.INSTANCE, TransportGetMonitorV2Action::class.java),
293-
ActionPlugin.ActionHandler(SearchMonitorV2Action.INSTANCE, TransportSearchMonitorV2Action::class.java),
294-
ActionPlugin.ActionHandler(DeleteMonitorV2Action.INSTANCE, TransportDeleteMonitorV2Action::class.java),
295-
ActionPlugin.ActionHandler(ExecuteMonitorV2Action.INSTANCE, TransportExecuteMonitorV2Action::class.java),
296-
ActionPlugin.ActionHandler(GetAlertsV2Action.INSTANCE, TransportGetAlertsV2Action::class.java)
252+
ActionPlugin.ActionHandler(DocLevelMonitorFanOutAction.INSTANCE, TransportDocLevelMonitorFanOutAction::class.java)
297253
)
298254
}
299255

300256
override fun getNamedXContent(): List<NamedXContentRegistry.Entry> {
301257
return listOf(
302258
Monitor.XCONTENT_REGISTRY,
303-
MonitorV2.XCONTENT_REGISTRY,
304259
SearchInput.XCONTENT_REGISTRY,
305260
DocLevelMonitorInput.XCONTENT_REGISTRY,
306261
QueryLevelTrigger.XCONTENT_REGISTRY,
@@ -330,7 +285,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
330285
val settings = environment.settings()
331286
val lockService = LockService(client, clusterService)
332287
alertIndices = AlertIndices(settings, client, threadPool, clusterService)
333-
alertV2Indices = AlertV2Indices(settings, client, threadPool, clusterService)
334288
val alertService = AlertService(client, xContentRegistry, alertIndices)
335289
val triggerService = TriggerService(scriptService)
336290
runner = MonitorRunnerService
@@ -342,7 +296,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
342296
.registerSettings(settings)
343297
.registerThreadPool(threadPool)
344298
.registerAlertIndices(alertIndices)
345-
.registerAlertV2Indices(alertV2Indices)
346299
.registerInputService(
347300
InputService(
348301
client,
@@ -369,7 +322,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
369322
scheduler = JobScheduler(threadPool, runner)
370323
sweeper = JobSweeper(environment.settings(), client, clusterService, threadPool, xContentRegistry, scheduler, ALERTING_JOB_TYPES)
371324
destinationMigrationCoordinator = DestinationMigrationCoordinator(client, clusterService, threadPool, scheduledJobIndices)
372-
alertV2Mover = AlertV2Mover(environment.settings(), client, threadPool, clusterService, xContentRegistry)
373325
this.threadPool = threadPool
374326
this.clusterService = clusterService
375327

@@ -397,7 +349,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
397349
commentsIndices,
398350
docLevelMonitorQueries,
399351
destinationMigrationCoordinator,
400-
alertV2Mover,
401352
lockService,
402353
alertService,
403354
triggerService
@@ -481,23 +432,6 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
481432
AlertingSettings.COMMENTS_MAX_CONTENT_SIZE,
482433
AlertingSettings.MAX_COMMENTS_PER_ALERT,
483434
AlertingSettings.MAX_COMMENTS_PER_NOTIFICATION,
484-
AlertingSettings.ALERT_V2_HISTORY_ENABLED,
485-
AlertingSettings.ALERT_V2_HISTORY_ROLLOVER_PERIOD,
486-
AlertingSettings.ALERT_V2_HISTORY_INDEX_MAX_AGE,
487-
AlertingSettings.ALERT_V2_HISTORY_MAX_DOCS,
488-
AlertingSettings.ALERT_V2_HISTORY_RETENTION_PERIOD,
489-
AlertingSettings.ALERT_V2_MONITOR_EXECUTION_MAX_DURATION,
490-
AlertingSettings.ALERTING_V2_MAX_MONITORS,
491-
AlertingSettings.ALERTING_V2_MAX_THROTTLE_DURATION,
492-
AlertingSettings.ALERTING_V2_MAX_EXPIRE_DURATION,
493-
AlertingSettings.ALERTING_V2_MAX_LOOK_BACK_WINDOW,
494-
AlertingSettings.ALERTING_V2_MAX_QUERY_LENGTH,
495-
AlertingSettings.ALERTING_V2_QUERY_RESULTS_MAX_DATAROWS,
496-
AlertingSettings.ALERT_V2_QUERY_RESULTS_MAX_SIZE,
497-
AlertingSettings.ALERT_V2_PER_RESULT_TRIGGER_MAX_ALERTS,
498-
AlertingSettings.NOTIFICATION_SUBJECT_SOURCE_MAX_LENGTH,
499-
AlertingSettings.NOTIFICATION_MESSAGE_SOURCE_MAX_LENGTH,
500-
AlertingV2Settings.ALERTING_V2_ENABLED,
501435
AlertingSettings.NOTIFICATION_CONTEXT_RESULTS_ALLOWED_ROLES
502436
)
503437
}
@@ -516,8 +450,7 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
516450
return listOf(
517451
SystemIndexDescriptor(ALL_ALERT_INDEX_PATTERN, "Alerting Plugin system index pattern"),
518452
SystemIndexDescriptor(SCHEDULED_JOBS_INDEX, "Alerting Plugin Configuration index"),
519-
SystemIndexDescriptor(ALL_COMMENTS_INDEX_PATTERN, "Alerting Comments system index pattern"),
520-
SystemIndexDescriptor(ALL_ALERT_V2_INDEX_PATTERN, "Alerting V2 Alerts index pattern")
453+
SystemIndexDescriptor(ALL_COMMENTS_INDEX_PATTERN, "Alerting Comments system index pattern")
521454
)
522455
}
523456

0 commit comments

Comments
 (0)