Skip to content

Commit

Permalink
add workflow_id field in alert mapping (#969) (#970)
Browse files Browse the repository at this point in the history
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit 62d2524)

Co-authored-by: Surya Sashank Nistala <snistala@amazon.com>
  • Loading branch information
opensearch-trigger-bot[bot] and eirsep authored Jun 22, 2023
1 parent 96365c6 commit 4954387
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,14 @@ class AlertService(
throw IllegalStateException("Unexpected attempt to save ${alert.state} alert: $alert")
}
}
Alert.State.AUDIT -> {
listOf<DocWriteRequest<*>>(
IndexRequest(alertsIndex)
.routing(alert.monitorId)
.source(alert.toXContentWithUser(XContentFactory.jsonBuilder()))
.id(if (alert.id != Alert.NO_ID) alert.id else null)
)
}
Alert.State.DELETED -> {
throw IllegalStateException("Unexpected attempt to save ${alert.state} alert: $alert")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"monitor_id": {
"type": "keyword"
},
"workflow_id": {
"type": "keyword"
},
"monitor_version": {
"type": "long"
},
Expand Down

0 comments on commit 4954387

Please sign in to comment.