Commit 441711e
authored
Skip service discovery system-probe calls in cluster check runners (#54926)
### What does this PR do?
Stops the Agent from attempting to reach a local system-probe socket when running as a Cluster Checks Runner (CCR), caused by: #48000
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 (`/opt/datadog-agent/run/sysprobe.sock`). Despite that, the workloadmeta process collector's service-discovery goroutine unconditionally queried system-probe's `/services` endpoint on CCR, which can never succeed there, and kept retrying on every collection interval, logging a `no such file or directory` error each time.
This PR adds a `helper.IsCLCRunner(...)` guard to `isServiceDiscoveryEnabled()` in `comp/core/workloadmeta/collectors/internal/process/process_collector.go`, so service discovery is treated as disabled on CCR regardless of the `discovery.enabled` system-probe config setting. This only gates the service-discovery goroutine and its system-probe calls; process collection, language detection, and GPU monitoring are unaffected.
There is no change in behavior for the node Agent or Cluster Agent. The guard is scoped to `helper.IsCLCRunner(...)`.
### Motivation
CONS-8502
Cluster Checks Runners have always attempted to query system-probe for service discovery on startup and on every collection interval, even though they're fundamentally incapable of reaching it (no local system-probe socket, since CCR isn't colocated per-node). This produces recurring `ERROR` logs about the missing socket, with no chance of ever succeeding.
### Describe how you validated your changes
- Added a unit test case in `TestStartConfiguration` (`process_collector_test.go`) verifying that `clc_runner_enabled: true` with `config_providers: [clusterchecks]` disables the collector even when `discovery.enabled: true`.
- Built a test image and deployed it as a real CCR pod in a cluster to reproduce and validate.
Co-authored-by: patrick.liang <patrick.liang@datadoghq.com>1 parent 2d00390 commit 441711e
3 files changed
Lines changed: 23 additions & 0 deletions
File tree
- comp/core/workloadmeta/collectors/internal/process
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
198 | 207 | | |
199 | 208 | | |
200 | 209 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
573 | 585 | | |
574 | 586 | | |
575 | 587 | | |
| |||
0 commit comments