Added fatal_exception field for ccr stats in monitoring mapping. (#37563)

This commit is contained in:
Martijn van Groningen 2019-01-17 14:04:41 +01:00 committed by GitHub
parent d9fa4e4ada
commit b85bfd3e17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -230,7 +230,7 @@ public class FollowStatsMonitoringDocTests extends BaseMonitoringDocTestCase<Fol
10,
fetchExceptions,
2,
null);
new ElasticsearchException("fatal error"));
XContentBuilder builder = jsonBuilder();
builder.value(status);
Map<String, Object> serializedStatus = XContentHelper.convertToMap(XContentType.JSON.xContent(), Strings.toString(builder), false);
@ -266,6 +266,11 @@ public class FollowStatsMonitoringDocTests extends BaseMonitoringDocTestCase<Fol
assertThat(exceptionFieldMapping.size(), equalTo(2));
assertThat(XContentMapValues.extractValue("type.type", exceptionFieldMapping), equalTo("keyword"));
assertThat(XContentMapValues.extractValue("reason.type", exceptionFieldMapping), equalTo("text"));
} else if (fieldName.equals("fatal_exception")) {
assertThat(fieldType, equalTo("object"));
assertThat(((Map<?, ?>) fieldMapping.get("properties")).size(), equalTo(2));
assertThat(XContentMapValues.extractValue("properties.type.type", fieldMapping), equalTo("keyword"));
assertThat(XContentMapValues.extractValue("properties.reason.type", fieldMapping), equalTo("text"));
} else {
fail("unexpected field value type [" + fieldValue.getClass() + "] for field [" + fieldName + "]");
}

View File

@ -1028,6 +1028,17 @@
},
"time_since_last_read_millis": {
"type": "long"
},
"fatal_exception": {
"type": "object",
"properties": {
"type" : {
"type": "keyword"
},
"reason": {
"type": "text"
}
}
}
}
},