From 5c4b7167dad62b717466794648e59649a20752c4 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Mon, 17 Sep 2018 18:29:30 -0700 Subject: [PATCH] [Monitoring] Removing unused version.* fields (#33584) This PR removes fields that are not actually used by the Monitoring UI. This will greatly simplify the eventual migration to using Metricbeat for monitoring Elasticsearch (see https://github.com/elastic/beats/pull/8260#discussion_r215885868 for more context and discussion around removing these fields from ES collection). --- .../collector/indices/IndexStatsMonitoringDoc.java | 9 --------- .../collector/indices/IndexStatsMonitoringDocTests.java | 4 ---- .../xpack/monitoring/integration/MonitoringIT.java | 2 +- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDoc.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDoc.java index f90abb1639d5c..c72e645dfd04f 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDoc.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDoc.java @@ -69,13 +69,6 @@ protected void innerToXContent(XContentBuilder builder, Params params) throws IO builder.field("created", metaData.getCreationDate()); builder.field("status", health.getStatus().name().toLowerCase(Locale.ROOT)); - builder.startObject("version"); - { - builder.field("created", metaData.getCreationVersion()); - builder.field("upgraded", metaData.getUpgradedVersion()); - } - builder.endObject(); - builder.startObject("shards"); { final int total = metaData.getTotalNumberOfShards(); @@ -128,8 +121,6 @@ protected void innerToXContent(XContentBuilder builder, Params params) throws IO "index_stats.uuid", "index_stats.created", "index_stats.status", - "index_stats.version.created", - "index_stats.version.upgraded", "index_stats.shards.total", "index_stats.shards.primaries", "index_stats.shards.replicas", diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDocTests.java index 278af123625e7..da9063507daa0 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/indices/IndexStatsMonitoringDocTests.java @@ -290,10 +290,6 @@ private String indexStatsSummary() { "\"uuid\":\"" + index.getUUID() + "\"," + "\"created\":" + metaData.getCreationDate() + "," + "\"status\":\"" + indexHealth.getStatus().name().toLowerCase(Locale.ROOT) + "\"," + - "\"version\":{" + - "\"created\":\"" + metaData.getCreationVersion() + "\"," + - "\"upgraded\":\"" + metaData.getUpgradedVersion() + "\"" + - "}," + "\"shards\":{" + "\"total\":" + total + "," + "\"primaries\":" + primaries + "," + diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/integration/MonitoringIT.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/integration/MonitoringIT.java index d1d71111f0fbe..3cefd7ea15d00 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/integration/MonitoringIT.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/integration/MonitoringIT.java @@ -419,7 +419,7 @@ private void assertIndexStatsMonitoringDoc(final Map document) { // particular field values checked in the index stats tests final Map indexStats = (Map) source.get(IndexStatsMonitoringDoc.TYPE); - assertEquals(8, indexStats.size()); + assertEquals(7, indexStats.size()); assertThat((String) indexStats.get("index"), not(isEmptyOrNullString())); assertThat((String) indexStats.get("uuid"), not(isEmptyOrNullString())); assertThat(indexStats.get("created"), notNullValue());