Skip to content

Commit f905562

Browse files
committed
Added fatal_exception field for ccr stats in monitoring mapping. (#37563)
1 parent f106b97 commit f905562

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/monitoring/collector/ccr/FollowStatsMonitoringDocTests.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public void testShardFollowNodeTaskStatusFieldsMapped() throws IOException {
230230
10,
231231
fetchExceptions,
232232
2,
233-
null);
233+
new ElasticsearchException("fatal error"));
234234
XContentBuilder builder = jsonBuilder();
235235
builder.value(status);
236236
Map<String, Object> serializedStatus = XContentHelper.convertToMap(XContentType.JSON.xContent(), Strings.toString(builder), false);
@@ -266,6 +266,11 @@ public void testShardFollowNodeTaskStatusFieldsMapped() throws IOException {
266266
assertThat(exceptionFieldMapping.size(), equalTo(2));
267267
assertThat(XContentMapValues.extractValue("type.type", exceptionFieldMapping), equalTo("keyword"));
268268
assertThat(XContentMapValues.extractValue("reason.type", exceptionFieldMapping), equalTo("text"));
269+
} else if (fieldName.equals("fatal_exception")) {
270+
assertThat(fieldType, equalTo("object"));
271+
assertThat(((Map<?, ?>) fieldMapping.get("properties")).size(), equalTo(2));
272+
assertThat(XContentMapValues.extractValue("properties.type.type", fieldMapping), equalTo("keyword"));
273+
assertThat(XContentMapValues.extractValue("properties.reason.type", fieldMapping), equalTo("text"));
269274
} else {
270275
fail("unexpected field value type [" + fieldValue.getClass() + "] for field [" + fieldName + "]");
271276
}

x-pack/plugin/core/src/main/resources/monitoring-es.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,17 @@
10281028
},
10291029
"time_since_last_read_millis": {
10301030
"type": "long"
1031+
},
1032+
"fatal_exception": {
1033+
"type": "object",
1034+
"properties": {
1035+
"type" : {
1036+
"type": "keyword"
1037+
},
1038+
"reason": {
1039+
"type": "text"
1040+
}
1041+
}
10311042
}
10321043
}
10331044
},

0 commit comments

Comments
 (0)