From 42b209fa8bfddeec0f18557f0bb555a48636f05a Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Fri, 15 May 2020 08:19:53 -0700 Subject: [PATCH] Update version when bulk param is available in ES stats API (#18459) * Update version when bulk param is available in ES stats API * Updating unit tests --- metricbeat/module/elasticsearch/elasticsearch.go | 2 +- metricbeat/module/elasticsearch/index/index_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/metricbeat/module/elasticsearch/elasticsearch.go b/metricbeat/module/elasticsearch/elasticsearch.go index 46825ee00840..ea660915e718 100644 --- a/metricbeat/module/elasticsearch/elasticsearch.go +++ b/metricbeat/module/elasticsearch/elasticsearch.go @@ -66,7 +66,7 @@ var CCRStatsAPIAvailableVersion = common.MustNewVersion("6.5.0") var EnrichStatsAPIAvailableVersion = common.MustNewVersion("7.5.0") // BulkStatsAvailableVersion is the version since when bulk indexing stats are available -var BulkStatsAvailableVersion = common.MustNewVersion("7.8.0") +var BulkStatsAvailableVersion = common.MustNewVersion("8.0.0") // Global clusterIdCache. Assumption is that the same node id never can belong to a different cluster id. var clusterIDCache = map[string]string{} diff --git a/metricbeat/module/elasticsearch/index/index_test.go b/metricbeat/module/elasticsearch/index/index_test.go index 8c4106e9944e..3f6119180ae6 100644 --- a/metricbeat/module/elasticsearch/index/index_test.go +++ b/metricbeat/module/elasticsearch/index/index_test.go @@ -37,7 +37,7 @@ func TestGetServiceURI(t *testing.T) { expectedPath: statsPath, }, "bulk_stats_available": { - esVersion: common.MustNewVersion("7.8.0"), + esVersion: common.MustNewVersion("8.0.0"), expectedPath: strings.Replace(statsPath, statsMetrics, statsMetrics+",bulk", 1), }, } @@ -58,7 +58,7 @@ func TestGetServiceURIMultipleCalls(t *testing.T) { var uri string var err error for i := uint(0); i < numCalls; i++ { - uri, err = getServicePath(*common.MustNewVersion("7.8.0")) + uri, err = getServicePath(*common.MustNewVersion("8.0.0")) if err != nil { return false }