Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ go_library(
"//comp/core/telemetry/def",
"//comp/core/telemetry/impl",
"//comp/core/workloadmeta/def",
"//pkg/config/helper",
"//pkg/config/model",
"//pkg/discovery/core",
"//pkg/discovery/language",
Expand Down Expand Up @@ -63,6 +64,7 @@ go_library(
"//comp/core/telemetry/def",
"//comp/core/telemetry/impl",
"//comp/core/workloadmeta/def",
"//pkg/config/helper",
"//pkg/config/model",
"//pkg/discovery/core",
"//pkg/discovery/language",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

"github.com/DataDog/datadog-agent/comp/core/config"
sysprobeconfig "github.com/DataDog/datadog-agent/comp/core/sysprobeconfig/def"
"github.com/DataDog/datadog-agent/pkg/config/helper"
pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model"
"github.com/DataDog/datadog-agent/pkg/languagedetection/languagemodels"
"github.com/DataDog/datadog-agent/pkg/process/procutil"
Expand Down Expand Up @@ -195,6 +196,14 @@ func (c *collector) isProcessCollectionEnabled() bool {

// isServiceDiscoveryEnabled returns a boolean indicating if service discovery is enabled
func (c *collector) isServiceDiscoveryEnabled() bool {
// Cluster Checks Runners are Deployment replicas, not DaemonSets, so they
// are never colocated with a system-probe on the same node and have no
// hostPath mount for its socket. Service discovery can never succeed
// there, so skip it entirely to avoid endlessly retrying system-probe
// requests and spamming "no such file or directory" error logs.
if helper.IsCLCRunner(c.config) {
return false
}
return serviceDiscoveryEnabled(c.systemProbeConfig)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,18 @@ func TestStartConfiguration(t *testing.T) {
},
expectedError: errors.NewDisabled(componentName, "process collection, service discovery, language collection, and GPU monitoring are disabled"),
},
{
description: "service discovery enabled but disabled on CLC runner",
configOverrides: map[string]interface{}{
"process_config.process_collection.enabled": false,
"clc_runner_enabled": true,
"config_providers": []map[string]interface{}{{"name": "clusterchecks"}},
},
sysConfigOverrides: map[string]interface{}{
"discovery.enabled": true,
},
expectedError: errors.NewDisabled(componentName, "process collection, service discovery, language collection, and GPU monitoring are disabled"),
},
} {
t.Run(tc.description, func(t *testing.T) {
cfg := config.NewMock(t)
Expand Down
Loading