File tree 1 file changed +10
-2
lines changed
alerting/src/main/kotlin/org/opensearch/alerting
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -115,8 +115,16 @@ class DocumentLevelMonitorRunner : MonitorRunner() {
115
115
monitorCtx.alertIndices!! .createOrUpdateInitialFindingHistoryIndex(monitor.dataSources)
116
116
} catch (e: Exception ) {
117
117
val id = if (monitor.id.trim().isEmpty()) " _na_" else monitor.id
118
- logger.error(" Error setting up alerts and findings indices for monitor: $id " , e)
119
- monitorResult = monitorResult.copy(error = AlertingException .wrap(e))
118
+ val unwrappedException = ExceptionsHelper .unwrapCause(e)
119
+ if (unwrappedException is IllegalArgumentException && unwrappedException.message?.contains(" Limit of total fields" ) == true ) {
120
+ val errorMessage =
121
+ " Monitor [$id ] can't process index [$monitor .dataSources] due to field mapping limit"
122
+ logger.error(" Exception: ${unwrappedException.message} " )
123
+ monitorResult = monitorResult.copy(error = AlertingException (errorMessage, RestStatus .INTERNAL_SERVER_ERROR , e))
124
+ } else {
125
+ logger.error(" Error setting up alerts and findings indices for monitor: $id " , e)
126
+ monitorResult = monitorResult.copy(error = AlertingException .wrap(e))
127
+ }
120
128
}
121
129
try {
122
130
validate(monitor)
You can’t perform that action at this time.
0 commit comments