From b50d66cba4d49aae5518eb98a9c9db0e3bbc043e Mon Sep 17 00:00:00 2001 From: michel-laterman Date: Fri, 30 Jul 2021 13:51:59 -0700 Subject: [PATCH 1/2] Disable monitoring during fleetserver bootstrap process Set the monitoring.enabled flag to false during the fleet-server bootstrap process in order to ensure that no data is sent to an elasticsearch instance running on the same host. --- .../pkg/agent/application/fleet_server_bootstrap.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x-pack/elastic-agent/pkg/agent/application/fleet_server_bootstrap.go b/x-pack/elastic-agent/pkg/agent/application/fleet_server_bootstrap.go index 60be85147cf..df4d93c3c43 100644 --- a/x-pack/elastic-agent/pkg/agent/application/fleet_server_bootstrap.go +++ b/x-pack/elastic-agent/pkg/agent/application/fleet_server_bootstrap.go @@ -24,6 +24,7 @@ import ( "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/config" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/logger" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/monitoring" + monitoringCfg "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/monitoring/config" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/server" "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/core/status" reporting "github.com/elastic/beats/v7/x-pack/elastic-agent/pkg/reporter" @@ -85,6 +86,11 @@ func newFleetServerBootstrap( reporter := reporting.NewReporter(bootstrapApp.bgContext, log, bootstrapApp.agentInfo, logR) + if cfg.Settings.MonitoringConfig != nil { + cfg.Settings.MonitoringConfig.Enabled = false + } else { + cfg.Settings.MonitoringConfig = &monitoringCfg.MonitoringConfig{Enabled: false} + } monitor, err := monitoring.NewMonitor(cfg.Settings) if err != nil { return nil, errors.New(err, "failed to initialize monitoring") From d6a642efeaad64c0af47b9c209d14861ba0a9c96 Mon Sep 17 00:00:00 2001 From: michel-laterman Date: Mon, 9 Aug 2021 10:49:50 -0700 Subject: [PATCH 2/2] Add CHANGELOG entry --- x-pack/elastic-agent/CHANGELOG.next.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/elastic-agent/CHANGELOG.next.asciidoc b/x-pack/elastic-agent/CHANGELOG.next.asciidoc index d62632f449f..ac6d83cc05d 100644 --- a/x-pack/elastic-agent/CHANGELOG.next.asciidoc +++ b/x-pack/elastic-agent/CHANGELOG.next.asciidoc @@ -77,6 +77,7 @@ - Remove symlink.prev from previously failed upgrade {pull}26785[26785] - Fix apm-server supported outputs not being in sync with supported output types. {pull}26885[26885] - Set permissions during installation {pull}26665[26665] +- Disable monitoring during fleet-server bootstrapping. {pull}27222[27222] ==== New features