From af2cae3149c3ab8ff134fe3c8892d3f5abde74c8 Mon Sep 17 00:00:00 2001 From: Guy Arbitman Date: Wed, 4 Sep 2024 18:04:18 +0300 Subject: [PATCH] service discovery: Add check yaml by default (#29033) --- .../dist/conf.d/service_discovery.d/conf.yaml.default | 2 ++ omnibus/config/software/datadog-agent-finalize.rb | 3 +++ tasks/agent.py | 1 + .../agent-subcommands/configcheck/configcheck_nix_test.go | 8 +++++++- 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 cmd/agent/dist/conf.d/service_discovery.d/conf.yaml.default diff --git a/cmd/agent/dist/conf.d/service_discovery.d/conf.yaml.default b/cmd/agent/dist/conf.d/service_discovery.d/conf.yaml.default new file mode 100644 index 0000000000000..00d9a2dbba2c8 --- /dev/null +++ b/cmd/agent/dist/conf.d/service_discovery.d/conf.yaml.default @@ -0,0 +1,2 @@ +instances: + - {} diff --git a/omnibus/config/software/datadog-agent-finalize.rb b/omnibus/config/software/datadog-agent-finalize.rb index b6df0ab46e821..2d545f58b498b 100644 --- a/omnibus/config/software/datadog-agent-finalize.rb +++ b/omnibus/config/software/datadog-agent-finalize.rb @@ -52,6 +52,9 @@ # load isn't supported by windows delete "#{conf_dir}/load.d" + # service_discovery isn't supported by windows + delete "#{conf_dir}/service_discovery.d" + # Remove .pyc files from embedded Python command "del /q /s #{windows_safe_path(install_dir)}\\*.pyc" end diff --git a/tasks/agent.py b/tasks/agent.py index c92f5d8399782..8474176fc244f 100644 --- a/tasks/agent.py +++ b/tasks/agent.py @@ -76,6 +76,7 @@ "orchestrator_ecs", "cisco_sdwan", "network_path", + "service_discovery", ] WINDOWS_CORECHECKS = [ diff --git a/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_nix_test.go b/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_nix_test.go index 74562bfff59eb..6f6e744e09bcb 100644 --- a/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_nix_test.go @@ -25,7 +25,7 @@ func TestLinuxConfigCheckSuite(t *testing.T) { e2e.Run(t, &linuxConfigCheckSuite{}, e2e.WithProvisioner(awshost.ProvisionerNoFakeIntake())) } -// cpu, disk, file_handle, io, load, memory, network, ntp, uptime +// cpu, disk, file_handle, io, load, memory, network, ntp, uptime, service_discovery func (v *linuxConfigCheckSuite) TestDefaultInstalledChecks() { testChecks := []CheckConfigOutput{ { @@ -82,6 +82,12 @@ func (v *linuxConfigCheckSuite) TestDefaultInstalledChecks() { InstanceID: "uptime:", Settings: "{}", }, + { + CheckName: "service_discovery", + Filepath: "file:/etc/datadog-agent/conf.d/service_discovery.d/conf.yaml.default", + InstanceID: "service_discovery:", + Settings: "{}", + }, } output := v.Env().Agent.Client.ConfigCheck()