Skip to content

Commit

Permalink
add workflow_id field in alert mapping (#969)
Browse files Browse the repository at this point in the history
Signed-off-by: Surya Sashank Nistala <[email protected]>
  • Loading branch information
eirsep authored Jun 22, 2023
1 parent b3c3f23 commit 62d2524
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 @@ -542,6 +542,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 62d2524

Please sign in to comment.