Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds chained alerts #976

Merged
merged 29 commits into from
Jul 12, 2023
Merged

Conversation

eirsep
Copy link
Member

@eirsep eirsep commented Jul 5, 2023

Adds chained alerts - alerts created when chained alert trigger conditions in workflows are satisfied.

We use Painless scripting language to define chained alerts condition
Examples

  • monitor[id=1] && (!monitor[id=2] || monitor[id=3])
    • Matches monitor id 1 generates an alert and either monitor id 2 doesn’t generate alert or monitor id 3 generates alert
  • monitor[id=1] && monitor[id=2]
    • Chained alert created if monitors with id 1 and 2 both generate alerts in current execution
  • monitor[id=1] || monitor[id=2]
    • Chained alert created if either monitor with id 1 or 2 generates an alert in current execution

PR also introduces the logic for AUDIT state alerts :

  • When workflows have chained alert triggers configured, alerts created by delegate monitors don't need to be acknowledged and don't need to notify users. Chained alert triggers will have actions.
  • They are simply used to evaluate the chained alert trigger conditions and for auditing why a chained alert was not created in a particular execution.
  • These alerts will be created in AUDIT state.
  • They will be created in alerts history index.
  • They don't need to be acknowledged
  • They are created only when chained alert triggers are defined in the workflow.

} catch (ex: Exception) {
logger.error("Error executing workflow delegate. Error: ${ex.message}", ex)
logger.error("Error executing workflow delegate monitor ${delegate.monitorId}", ex)
lastErrorDelegateRun = AlertingException.wrap(ex)
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be break not continue

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

// Only apply jacoco test coverage if we are running a local single node cluster
if (!usingRemoteCluster && !usingMultiNode) {
apply from: '../build-tools/opensearchplugin-coverage.gradle'
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we removing this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted

@@ -122,7 +125,9 @@ class AlertService(
fun composeQueryLevelAlert(
ctx: QueryLevelTriggerExecutionContext,
result: QueryLevelTriggerRunResult,
alertError: AlertError?
alertError: AlertError?,
executionId: String? = null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we want the executionId to be optional? I remember conversations about this being required to help with auditing in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

made it mandatory in monitors.

@@ -218,32 +224,31 @@ object MonitorRunnerService : JobRunner, CoroutineScope, AbstractLifecycleCompon
}

override fun runJob(job: ScheduledJob, periodStart: Instant, periodEnd: Instant) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add comments here on why we can only have 1 job runner and not a separate one for workflows? And we can talk about if the job scheduler plugin takes care of this, we can go back to having 2 job runners.


// Updating the scheduled job index at the start of monitor execution runs for when there is an upgrade the the schema mapping
// has not been updated.
if (!IndexUtils.scheduledJobIndexUpdated && monitorCtx.clusterService != null && monitorCtx.client != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this to make sure the config index is updated before monitors/workflows execute to prevent mapping problems.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted. thanks.

// if the script fails we need to send an alert so set triggered = true
ChainedAlertTriggerRunResult(
triggerName = trigger.name,
triggered = false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says to set it to true, but its false here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -509,7 +563,8 @@ class AlertService(
dataSources: DataSources,
alerts: List<Alert>,
retryPolicy: BackoffPolicy,
allowUpdatingAcknowledgedAlert: Boolean = false
allowUpdatingAcknowledgedAlert: Boolean = false,
routing: String? = null // routing is mandatory and set as monitor id. for workflow chained alerts we pass workflow id as routing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this optional if its mandatory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made routing mandatory

@@ -580,9 +599,12 @@ class AlertService(
}
}
Alert.State.AUDIT -> {
val index = if (alertIndices.isAlertHistoryEnabled()) {
dataSources.alertsHistoryIndex
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's create an issue for investigating how to handle migration of data when alert history setting is flipped.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created issue.

@eirsep eirsep force-pushed the composite-monitors branch 9 times, most recently from a3be79c to a543356 Compare July 10, 2023 21:07
return Alert(
startTime = Instant.now(),
lastNotificationTime = Instant.now(),
state = Alert.State.ACTIVE,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the previous alert was active for the chained alert, do we ignore that and not extend the existing alert and add more info there like query level and bucket level monitors? This logic is more similar to doc level, which would make less sense for chained alerts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will discuss this more with folks and fix this logic

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the underlying motivation was that the chained alert can be created for that particular execution and be associated with delegate monitor alerts from that execution. will have to see if extending an alert fits this thinking.


return RestChannelConsumer { channel ->
val dryrun = request.paramAsBoolean("dryrun", false)
val requestEnd = request.paramAsTime("period_end", TimeValue(Instant.now().toEpochMilli()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there another param for this called, period_end? If so, what is it exactly for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

val (periodStart, periodEnd) =
workflow.schedule.getPeriodEndingAt(Instant.ofEpochMilli(execWorkflowRequest.requestEnd.millis))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

import org.opensearch.rest.action.RestToXContentListener

/**
* This class consists of the REST handler to retrieve alerts .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this include chained alerts as well?

Copy link
Member Author

@eirsep eirsep Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. workflow alerts are only chained alerts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updating java doc

Comment on lines 144 to 148
val queryBuilder = QueryBuilders.nestedQuery(
TransportDeleteWorkflowAction.WORKFLOW_DELEGATE_PATH,
QueryBuilders.boolQuery().must(
QueryBuilders.matchQuery(
TransportDeleteWorkflowAction.WORKFLOW_MONITOR_PATH,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally the WORKFLOW_DELEGATE_PATH and WORKFLOW_MONITOR_PATH constants should be in a central constants file for workflows.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to utils class

Signed-off-by: Surya Sashank Nistala <[email protected]>
…pi for fetching chained alerts - workflow alerts api

Signed-off-by: Surya Sashank Nistala <[email protected]>
workflow.inputs.isNotEmpty() && workflow.inputs[0] is CompositeInput &&
(workflow.inputs[0] as CompositeInput).sequence.delegates.isNotEmpty()
) {
val i = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i is always 0 and never incremented.

(workflow.inputs[0] as CompositeInput).sequence.delegates.isNotEmpty()
) {
val i = 0
val delegates = (workflow.inputs[i] as CompositeInput).sequence.delegates
Copy link
Member

@lezzago lezzago Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be: val delegates = (workflow.inputs[0] as CompositeInput).sequence.delegates?

getResponse =
client.suspendUntil {
client.get(
GetRequest(ScheduledJob.SCHEDULED_JOBS_INDEX, delegates[0].monitorId),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be: GetRequest(ScheduledJob.SCHEDULED_JOBS_INDEX, delegates[i].monitorId),?

else monitor.dataSources.alertsHistoryIndex!!
}
}
} catch (e: java.lang.Exception) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: you can make this } catch (e: Exception) {

@@ -162,7 +161,7 @@ class TransportGetAlertsAction @Inject constructor(
*/
suspend fun resolveAlertsIndexName(getAlertsRequest: GetAlertsRequest): String {
var alertIndex = AlertIndices.ALL_ALERT_INDEX_PATTERN
if (!getAlertsRequest.alertIndex.isNullOrEmpty()) {
if (getAlertsRequest.alertIndex.isNullOrEmpty() == false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? The previous way was cleaner.

Comment on lines +172 to +173
alertIndex = monitor.dataSources.alertsIndex
alertHistoryIndex =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if multiple monitors have different data sources and part of the same workflow? This wont move all the alerts and they get stuck defunct.

Copy link
Member

@lezzago lezzago Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this is only for alerts that are not going to be in the audit state, right? Since audit alerts should be in the history index automatically?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflows currently assume same datasources for all monitors

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the workflow enforce a single data source for all monitors?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not doing a validation but right now there is no real world scenario where we add monitors with different data sources because-
rest apis dont support data sources and are populatd with alerting system indices
security analytics detectos have one data source each and wont intermix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not doing a validation but right now there is no real world scenario where we add monitors with different data sources because-
rest apis dont support data sources and are populatd with alerting system indices
security analytics detectos have one data source each and wont intermix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a github issue to ensure workflows have monitors of a single data source only

@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Merging #976 (f509a74) into main (a5ad3b9) will decrease coverage by 1.04%.
The diff coverage is 65.68%.

@@             Coverage Diff              @@
##               main     #976      +/-   ##
============================================
- Coverage     74.67%   73.63%   -1.04%     
- Complexity      111      113       +2     
============================================
  Files           144      158      +14     
  Lines          8362     9326     +964     
  Branches       1224     1365     +141     
============================================
+ Hits           6244     6867     +623     
- Misses         1499     1764     +265     
- Partials        619      695      +76     
Impacted Files Coverage Δ
...pensearch/alerting/service/DeleteMonitorService.kt 69.62% <ø> (ø)
...lerting/transport/TransportDeleteWorkflowAction.kt 79.61% <ø> (ø)
...org/opensearch/alerting/workflow/WorkflowRunner.kt 1.16% <0.00%> (-98.84%) ⬇️
...rch/alerting/model/ChainedAlertTriggerRunResult.kt 34.48% <34.48%> (ø)
...g/opensearch/alerting/action/GetMonitorResponse.kt 67.18% <43.75%> (-25.32%) ⬇️
...org/opensearch/alerting/model/WorkflowRunResult.kt 51.16% <50.00%> (+27.16%) ⬆️
.../org/opensearch/alerting/util/ScheduledJobUtils.kt 53.33% <53.33%> (ø)
...ransport/TransportAcknowledgeChainedAlertAction.kt 61.03% <61.03%> (ø)
...n/kotlin/org/opensearch/alerting/TriggerService.kt 71.62% <62.50%> (-8.74%) ⬇️
...in/org/opensearch/alerting/MonitorRunnerService.kt 74.24% <63.41%> (-1.23%) ⬇️
... and 25 more

... and 7 files with indirect coverage changes

launch {
try {
monitorCtx.moveAlertsRetryPolicy!!.retry(logger) {
moveAlerts(monitorCtx.client!!, job.id, job, monitorCtx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check if the alerts index is initialized if its not using a different datasource. Move alerts checks only if the datasource alerts index is initialized if there is a data source.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datasource is always there
for monitors created directly by alerting plugin through rest api or dashboards we populate them with defaults

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Signed-off-by: Surya Sashank Nistala <[email protected]>
@@ -123,7 +130,9 @@ class AlertService(
fun composeQueryLevelAlert(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we combine these Alert compositions into a single logic for common pieces to reduce duplicate code? Not a PR blocker - we can add to the backlog in META

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the logic to save an alert is common across all monitors.

this is the logic to create a new alert which IMO should be in different methods and doesn't need a change as they all use different constructors to set their corresponding set of fields in alerts

@@ -554,9 +609,12 @@ class AlertService(
}
}
Alert.State.AUDIT -> {
val index = if (alertIndices.isAlertHistoryEnabled()) {
dataSources.alertsHistoryIndex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can flipping the alert history index enablement hinder the ability to read the history data during upgrades?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that problem exists. we have an issue created to deal with it

* 3. Delete alerts from monitor's DataSources.alertsIndex
* 4. Schedule a retry if there were any failures
*/
suspend fun moveAlerts(client: Client, workflowId: String, workflow: Workflow?, monitorCtx: MonitorRunnerExecutionContext) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we ensure we are consistent and not adding regression during version upgrades. Two important things to consider:

  1. Serialization/De-Ser during node to node interaction (with old and new version of the plugin) is not breaking and new version is backward compatible.
  2. Data (History, Config and System/Hidden indices) are read/updated across versions without causing regressions.

Copy link
Member Author

@eirsep eirsep Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. There won't be regressions.

  1. The moveAlerts method is always called within a try catch block and will not cause any issue with cross version Serialization/De-Ser.
  2. We have added workflows as a new resource and have not edited any current resource.
  3. all fields related to workflows have been as optional fields in existing resources such as monitors alerts findings
    and we have tests for alerts to verify parsing the old version alerts by the current version

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Can we ensure all transport interactions are also adhering to it and are backward compatible. This is to ensure no regressions due to heterogeneous fleet during upgrades.

* Solves the Trigger Expression using the Reverse Polish Notation (RPN) based solver
* @param polishNotation an array of expression tokens organized in the RPN order
*/
class ChainedAlertRPNResolver(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering why we did not extend on the current TriggerExpressionResolver

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i had started out to do that but midway realized I had a much simpler use case which relied on RPN resolution and needed a different method too.

We can explore extracting commonn logic out but method params were little different and I can do a follow up. Test classes have been added to verify the chained alerts parsing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks can we add to our backlog in the meta

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eirsep
Copy link
Member Author

eirsep commented Jul 12, 2023

Multi nodes tests are running on my local

Starting a Gradle Daemon, 1 busy and 1 incompatible Daemons could not be reused, use --status for details
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.1.1
  OS Info               : Mac OS X 13.4 (x86_64)
  JDK Version           : 17 (Amazon Corretto JDK)
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home
  Random Testing Seed   : F80379171DC47AA0
  In FIPS 140 mode      : false
=======================================

> Task :alerting-core:compileKotlin
w: /Users/snistala/Documents/opensearch/alerting/core/src/main/kotlin/org/opensearch/alerting/opensearchapi/OpenSearchExtensions.kt: (42, 27): 'convertToMap(BytesReference!, Boolean, XContentType!): Tuple<XContentType!, (Mutable)Map<String!, Any!>!>!' is deprecated. Deprecated in Java

> Task :alerting:compileKotlin
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (218, 101): Unnecessary safe call on a non-null receiver of type AlertError. This expression will have nullable type in future releases
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (342, 13): Unsafe use of a nullable receiver of type TotalHits?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (343, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (344, 43): Unsafe use of a nullable receiver of type TotalHits?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (396, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (402, 21): Unsafe use of a nullable receiver of type TotalHits?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (403, 43): Unsafe use of a nullable receiver of type TotalHits?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (433, 111): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (458, 17): Unsafe use of a nullable receiver of type TotalHits?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/AlertService.kt: (515, 99): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/BucketLevelMonitorRunner.kt: (63, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (74, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (110, 60): Unchecked cast: MutableMap<String, Any> to MutableMap<String, MutableMap<String, Any>>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (270, 49): 'detailedMessage(Throwable!): String!' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (536, 59): Unnecessary non-null assertion (!!) on a non-null receiver of type ClusterService
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/DocumentLevelMonitorRunner.kt: (698, 57): Unchecked cast: Any to MutableMap<String, Any>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/MonitorMetadataService.kt: (174, 76): Unchecked cast: Map<String, Any> to MutableMap<String, MutableMap<String, Any>>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/QueryLevelMonitorRunner.kt: (29, 9): The corresponding parameter in the supertype 'MonitorRunner' is named 'dryRun'. This may cause problems when calling this function with named arguments.
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (225, 42): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (233, 42): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (280, 60): Unnecessary non-null assertion (!!) on a non-null receiver of type String
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/alerts/AlertIndices.kt: (282, 43): Unnecessary non-null assertion (!!) on a non-null receiver of type String
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/DocumentLevelTriggerRunResult.kt: (34, 51): No cast needed
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (41, 51): Unchecked cast: (Mutable)Map<String!, Any!>! to MutableMap<String, String>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (51, 48): Unchecked cast: MutableMap<String, String> to MutableMap<String, Any>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (61, 86): Unchecked cast: MutableMap<String, String> to MutableMap<String, Any>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/MonitorMetadata.kt: (101, 94): Unchecked cast: (Mutable)Map<String!, Any!>! to MutableMap<String, String>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/model/WorkflowMetadata.kt: (63, 20): '@JvmOverloads' annotation has no effect for methods without default arguments
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestDeleteWorkflowAction.kt: (49, 13): Variable 'refreshPolicy' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt: (48, 13): Variable 'srcContext' is assigned but never accessed
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestGetWorkflowAction.kt: (50, 13): The value 'FetchSourceContext.DO_NOT_FETCH_SOURCE' assigned to 'var srcContext: FetchSourceContext? defined in org.opensearch.alerting.resthandler.RestGetWorkflowAction.prepareRequest' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (87, 69): Unchecked cast: Any? to List<String>?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (92, 9): Non exhaustive 'when' statements on enum will be prohibited in 1.7, add 'CLUSTER_METRICS_MONITOR' branch or 'else' branch instead
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexMonitorAction.kt: (130, 13): Condition 'monitor.dataSources != null' is always 'true'
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/resthandler/RestIndexWorkflowAction.kt: (64, 69): Unchecked cast: Any? to List<String>?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt: (118, 21): Unsafe use of a nullable receiver of type TotalHits?
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/service/DeleteMonitorService.kt: (130, 25): Variable 'response' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt: (172, 29): Variable 'deleteMonitorWorkflowMetadataResponse' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportDeleteWorkflowAction.kt: (322, 17): Variable 'deleteResponse' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt: (571, 37): The expression is unused
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (169, 38): Unchecked cast: Any to MutableMap<String, Any>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (176, 80): Unchecked cast: Any to MutableMap<String, Any>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (180, 65): Unchecked cast: Any? to MutableMap<String, Any>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (213, 16): Unnecessary safe call on a non-null receiver of type List<String>. This expression will have nullable type in future releases
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (219, 29): Unchecked cast: Any? to MutableMap<String, Any>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (324, 37): Variable 'updateMappingResponse' initializer is redundant
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (343, 25): Name shadowed: updateMappingRequest
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (352, 25): Name shadowed: unwrappedException
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (365, 21): Name shadowed: unwrappedException
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/DocLevelMonitorQueries.kt: (395, 17): Variable 'updateSettingsResponse' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/util/destinationmigration/DestinationMigrationCoordinator.kt: (77, 45): 'getter for isLocalNodeElectedMaster: Boolean' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/main/kotlin/org/opensearch/alerting/workflow/CompositeWorkflowRunner.kt: (145, 17): Condition 'delegateRunResult != null' is always 'true'

> Task :alerting:compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :alerting:compileTestKotlin
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt: (573, 52): Unchecked cast: Any? to Map<String, Any>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/AlertingRestTestCase.kt: (590, 53): Unchecked cast: Any? to Map<String, Any>
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (188, 13): Variable 'testDoc' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (523, 13): Variable 'searchResult' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (562, 13): Variable 'searchResult' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (615, 13): Variable 'searchResult' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (676, 13): Variable 'searchResult' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/DocumentMonitorRunnerIT.kt: (697, 13): Variable 'testDoc' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (72, 8): This class shouldn't be used in Kotlin. Use kotlin.collections.Map or kotlin.collections.MutableMap instead.
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (340, 9): The value 'executeMonitor(monitor, id, false)' assigned to 'var executeMonitorResponse: ExecuteMonitorResponse? defined in org.opensearch.alerting.MonitorDataSourcesIT.`test execute monitor without triggers`' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (407, 13): Variable 'mappingsResp' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (996, 38): Variable 'executeMonitorResponse' initializer is redundant
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1085, 13): Variable 'clusterStateResponse' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1413, 13): Condition 'updateMonitorResponse != null' is always 'true'
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1414, 13): The value 'executeMonitor(updateMonitorResponse.monitor, monitorId, false)' assigned to 'var executeMonitorResponse: ExecuteMonitorResponse? defined in org.opensearch.alerting.MonitorDataSourcesIT.`test execute pre-existing monitor and update`' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1953, 27): Condition 'alerts != null' is always 'true'
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1971, 27): Condition 'alerts != null' is always 'true'
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (1979, 27): Condition 'alerts != null' is always 'true'
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2072, 27): Condition 'alerts != null' is always 'true'
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2088, 27): Condition 'alerts != null' is always 'true'
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2096, 27): Condition 'alerts != null' is always 'true'
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2140, 36): Unnecessary safe call on a non-null receiver of type IndexMonitorResponse?. This expression will have nullable type in future releases
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2178, 9): The value 'monitorResponse!!.monitor' assigned to 'var monitor: Monitor defined in org.opensearch.alerting.MonitorDataSourcesIT.`test queryIndex gets increased max fields in mappings`' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/MonitorDataSourcesIT.kt: (2223, 31): Condition 'alerts != null' is always 'true'
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/ODFERestTestCase.kt: (115, 18): 'OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_PASSWORD: String' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/ODFERestTestCase.kt: (116, 18): 'OPENSEARCH_SECURITY_SSL_HTTP_KEYSTORE_KEYPASSWORD: String' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (105, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (165, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (186, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (229, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (273, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/aggregation/bucketselectorext/BucketSelectorExtAggregatorTests.kt: (321, 17): 'assertThat(T!, Matcher<in T!>!): Unit' is deprecated. Deprecated in Java
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (833, 13): Variable 'alert' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/MonitorRestApiIT.kt: (916, 17): Name shadowed: alerts
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt: (1101, 75): Unnecessary safe call on a non-null receiver of type Response. This expression will have nullable type in future releases
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt: (1204, 89): Unnecessary safe call on a non-null receiver of type Response. This expression will have nullable type in future releases
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/resthandler/SecureWorkflowRestApiIT.kt: (1400, 73): Unnecessary non-null assertion (!!) on a non-null receiver of type Monitor
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (91, 9): The expression is unused
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (196, 13): Variable 'foundAlias' is never used
w: /Users/snistala/Documents/opensearch/alerting/alerting/src/test/kotlin/org/opensearch/alerting/transport/AlertingSingleNodeTestCase.kt: (207, 13): Variable 'foundAlias' is never used

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 4m 42s
19 actionable tasks: 19 executed

@eirsep eirsep merged commit 3911ca9 into opensearch-project:main Jul 12, 2023
10 of 16 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-976-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3911ca91881888c0a823cb684817378d0522d5c1
# Push it to GitHub
git push --set-upstream origin backport/backport-976-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-976-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.9 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.9 2.9
# Navigate to the new working tree
cd .worktrees/backport-2.9
# Create a new branch
git switch --create backport/backport-976-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 3911ca91881888c0a823cb684817378d0522d5c1
# Push it to GitHub
git push --set-upstream origin backport/backport-976-to-2.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.9

Then, create a pull request where the base branch is 2.9 and the compare/head branch is backport/backport-976-to-2.9.

eirsep added a commit to eirsep/alerting that referenced this pull request Jul 12, 2023
* chained alert triggers

Signed-off-by: Surya Sashank Nistala <[email protected]>

* converge all single node test cases

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add license headers to files

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix workflow not found issue

Signed-off-by: Surya Sashank Nistala <[email protected]>

* added audit state alerts for doc level monitors

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add audit alerts in query level monitor

Signed-off-by: Surya Sashank Nistala <[email protected]>

* temp: upload custom built common utils jar

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix get monitor response parsing to include associated_workflows

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add query level monitor audit alerts tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add audit alerts in bucket level monitor

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix workflow tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* alerting

Signed-off-by: Surya Sashank Nistala <[email protected]>

* verify bucket monitor audit alerts and chained alerts in workflow

Signed-off-by: Surya Sashank Nistala <[email protected]>

* make execution id mandatory

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert mapping update in run job method

Signed-off-by: Surya Sashank Nistala <[email protected]>

* minor fixes in chained alert trigger result

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix chained alert triggers tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix acknowledge chained alert bug

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert get alerts change

Signed-off-by: Surya Sashank Nistala <[email protected]>

* refactor and remove transport actions being invoked in other transport actions

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add license header

Signed-off-by: Surya Sashank Nistala <[email protected]>

* scheduled job mapping schema

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix ktlint and revert gradle dev set up chanegs

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix post delete method and refactor alert mover to add class level logger

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix test - pass workflow id in get alerts

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove monitor empty filter in get alerts api as there is dedicated api for fetching chained alerts - workflow alerts api

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix check for workflow id is empty or null in get alerts action

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix alert mover method delegate monitor parsing logic

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove common utils jar from repo

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>
eirsep added a commit that referenced this pull request Jul 12, 2023
* Adds chained alerts (#976)

* chained alert triggers

Signed-off-by: Surya Sashank Nistala <[email protected]>

* converge all single node test cases

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add license headers to files

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix workflow not found issue

Signed-off-by: Surya Sashank Nistala <[email protected]>

* added audit state alerts for doc level monitors

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add audit alerts in query level monitor

Signed-off-by: Surya Sashank Nistala <[email protected]>

* temp: upload custom built common utils jar

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix get monitor response parsing to include associated_workflows

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add query level monitor audit alerts tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add audit alerts in bucket level monitor

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix workflow tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* alerting

Signed-off-by: Surya Sashank Nistala <[email protected]>

* verify bucket monitor audit alerts and chained alerts in workflow

Signed-off-by: Surya Sashank Nistala <[email protected]>

* make execution id mandatory

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert mapping update in run job method

Signed-off-by: Surya Sashank Nistala <[email protected]>

* minor fixes in chained alert trigger result

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix chained alert triggers tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix acknowledge chained alert bug

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert get alerts change

Signed-off-by: Surya Sashank Nistala <[email protected]>

* refactor and remove transport actions being invoked in other transport actions

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add license header

Signed-off-by: Surya Sashank Nistala <[email protected]>

* scheduled job mapping schema

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix ktlint and revert gradle dev set up chanegs

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix post delete method and refactor alert mover to add class level logger

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix test - pass workflow id in get alerts

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove monitor empty filter in get alerts api as there is dedicated api for fetching chained alerts - workflow alerts api

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix check for workflow id is empty or null in get alerts action

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix alert mover method delegate monitor parsing logic

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove common utils jar from repo

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix imports

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 12, 2023
* Adds chained alerts (#976)

* chained alert triggers

Signed-off-by: Surya Sashank Nistala <[email protected]>

* converge all single node test cases

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add license headers to files

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix workflow not found issue

Signed-off-by: Surya Sashank Nistala <[email protected]>

* added audit state alerts for doc level monitors

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add audit alerts in query level monitor

Signed-off-by: Surya Sashank Nistala <[email protected]>

* temp: upload custom built common utils jar

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix get monitor response parsing to include associated_workflows

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add query level monitor audit alerts tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add audit alerts in bucket level monitor

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix workflow tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* alerting

Signed-off-by: Surya Sashank Nistala <[email protected]>

* verify bucket monitor audit alerts and chained alerts in workflow

Signed-off-by: Surya Sashank Nistala <[email protected]>

* make execution id mandatory

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert mapping update in run job method

Signed-off-by: Surya Sashank Nistala <[email protected]>

* minor fixes in chained alert trigger result

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix chained alert triggers tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix acknowledge chained alert bug

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert get alerts change

Signed-off-by: Surya Sashank Nistala <[email protected]>

* refactor and remove transport actions being invoked in other transport actions

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add license header

Signed-off-by: Surya Sashank Nistala <[email protected]>

* scheduled job mapping schema

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix ktlint and revert gradle dev set up chanegs

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix post delete method and refactor alert mover to add class level logger

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix test - pass workflow id in get alerts

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove monitor empty filter in get alerts api as there is dedicated api for fetching chained alerts - workflow alerts api

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix check for workflow id is empty or null in get alerts action

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix alert mover method delegate monitor parsing logic

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove common utils jar from repo

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix imports

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit d2d03c6)
eirsep added a commit that referenced this pull request Jul 12, 2023
* Adds chained alerts (#976)

* chained alert triggers

Signed-off-by: Surya Sashank Nistala <[email protected]>

* converge all single node test cases

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add license headers to files

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix workflow not found issue

Signed-off-by: Surya Sashank Nistala <[email protected]>

* added audit state alerts for doc level monitors

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add audit alerts in query level monitor

Signed-off-by: Surya Sashank Nistala <[email protected]>

* temp: upload custom built common utils jar

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix get monitor response parsing to include associated_workflows

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add query level monitor audit alerts tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add audit alerts in bucket level monitor

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix workflow tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* alerting

Signed-off-by: Surya Sashank Nistala <[email protected]>

* verify bucket monitor audit alerts and chained alerts in workflow

Signed-off-by: Surya Sashank Nistala <[email protected]>

* make execution id mandatory

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert mapping update in run job method

Signed-off-by: Surya Sashank Nistala <[email protected]>

* minor fixes in chained alert trigger result

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix chained alert triggers tests

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix acknowledge chained alert bug

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert get alerts change

Signed-off-by: Surya Sashank Nistala <[email protected]>

* refactor and remove transport actions being invoked in other transport actions

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add license header

Signed-off-by: Surya Sashank Nistala <[email protected]>

* scheduled job mapping schema

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix ktlint and revert gradle dev set up chanegs

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix post delete method and refactor alert mover to add class level logger

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix test - pass workflow id in get alerts

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove monitor empty filter in get alerts api as there is dedicated api for fetching chained alerts - workflow alerts api

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix check for workflow id is empty or null in get alerts action

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix alert mover method delegate monitor parsing logic

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove common utils jar from repo

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix imports

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit d2d03c6)

Co-authored-by: Surya Sashank Nistala <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport 2.9 backports PRs to 2.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants