diff --git a/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDoc.java b/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDoc.java index 0eb7221140a..414945c2a15 100644 --- a/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDoc.java +++ b/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDoc.java @@ -12,7 +12,6 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.collect.MapBuilder; -import org.elasticsearch.common.hash.MessageDigests; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.license.License; @@ -21,7 +20,6 @@ import org.elasticsearch.xpack.core.monitoring.MonitoredSystem; import org.elasticsearch.xpack.core.monitoring.exporter.MonitoringDoc; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.List; import java.util.Locale; @@ -133,7 +131,6 @@ public class ClusterStatsMonitoringDoc extends MonitoringDoc { .map(); params = new ToXContent.DelegatingMapParams(extraParams, params); license.toInnerXContent(builder, params); - builder.field("hkey", hash(license, getCluster())); if (clusterNeedsTLSEnabled) { builder.field("cluster_needs_tls", true); } @@ -197,12 +194,4 @@ public class ClusterStatsMonitoringDoc extends MonitoringDoc { return temp.toString().hashCode(); } - public static String hash(License license, String clusterName) { - return hash(license.status().label(), license.uid(), license.type(), String.valueOf(license.expiryDate()), clusterName); - } - - public static String hash(String licenseStatus, String licenseUid, String licenseType, String licenseExpiryDate, String clusterUUID) { - String toHash = licenseStatus + licenseUid + licenseType + licenseExpiryDate + clusterUUID; - return MessageDigests.toHexString(MessageDigests.sha256().digest(toHash.getBytes(StandardCharsets.UTF_8))); - } } diff --git a/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java b/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java index e26da862a58..4a096f0ca4a 100644 --- a/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java +++ b/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java @@ -22,7 +22,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.UnassignedInfo; import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.hash.MessageDigests; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.BoundTransportAddress; @@ -51,7 +50,6 @@ import org.elasticsearch.xpack.monitoring.exporter.BaseMonitoringDocTestCase; import org.junit.Before; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.List; import java.util.Map; @@ -188,38 +186,6 @@ public class ClusterStatsMonitoringDocTests extends BaseMonitoringDocTestCase clusterStats = (Map) source.get("cluster_stats"); assertThat(clusterStats, notNullValue()); assertThat(clusterStats.size(), equalTo(4));