From a020701b4a1a33f458f1efa2246bfea0dee6b22b Mon Sep 17 00:00:00 2001 From: andsel Date: Tue, 2 Nov 2021 18:06:46 +0100 Subject: [PATCH 1/2] Fixes a usage of deprecated 'http.enabled' to the new 'api.enabled' --- x-pack/lib/monitoring/inputs/metrics/stats_event_factory.rb | 2 +- .../spec/monitoring/inputs/metrics/stats_event_factory_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/lib/monitoring/inputs/metrics/stats_event_factory.rb b/x-pack/lib/monitoring/inputs/metrics/stats_event_factory.rb index 2b4037fe981..a70f85648e9 100644 --- a/x-pack/lib/monitoring/inputs/metrics/stats_event_factory.rb +++ b/x-pack/lib/monitoring/inputs/metrics/stats_event_factory.rb @@ -12,7 +12,7 @@ def initialize(global_stats, snapshot, cluster_uuid) @snapshot = snapshot @metric_store = @snapshot.metric_store @cluster_uuid = cluster_uuid - @webserver_enabled = LogStash::SETTINGS.get_value("http.enabled") + @webserver_enabled = LogStash::SETTINGS.get_value("api.enabled") end def make(agent, extended_performance_collection=true, collection_interval=10) diff --git a/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb b/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb index 7150bb76b87..cb5ebd934dd 100644 --- a/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb +++ b/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb @@ -17,7 +17,7 @@ global_stats = {"uuid" => "00001" } sut = described_class.new(global_stats, collector.snapshot_metric, nil) LogStash::SETTINGS.set_value("monitoring.enabled", false) - LogStash::SETTINGS.set_value("api.http.enabled", webserver_enabled) + LogStash::SETTINGS.set_value("api.4enabled", webserver_enabled) monitoring_evt = sut.make(agent, true) json = JSON.parse(monitoring_evt.to_json) From e78f19df43dce0f100ffc0bb0105eb679d3c5226 Mon Sep 17 00:00:00 2001 From: Andrea Selva Date: Mon, 8 Nov 2021 09:02:49 +0100 Subject: [PATCH 2/2] Fixed typo in stats_event_factory_spec Co-authored-by: Ry Biesemeyer --- .../spec/monitoring/inputs/metrics/stats_event_factory_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb b/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb index cb5ebd934dd..35b6ddb19ed 100644 --- a/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb +++ b/x-pack/spec/monitoring/inputs/metrics/stats_event_factory_spec.rb @@ -17,7 +17,7 @@ global_stats = {"uuid" => "00001" } sut = described_class.new(global_stats, collector.snapshot_metric, nil) LogStash::SETTINGS.set_value("monitoring.enabled", false) - LogStash::SETTINGS.set_value("api.4enabled", webserver_enabled) + LogStash::SETTINGS.set_value("api.enabled", webserver_enabled) monitoring_evt = sut.make(agent, true) json = JSON.parse(monitoring_evt.to_json)