fix(dogstatsd): always set DSD environment variables on Core Agent container#3032
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: fde94ea | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 327da97917
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| managers.EnvVar().AddEnvVarToContainer(apicommon.CoreAgentContainerName, &corev1.EnvVar{ | ||
| // defaults to 8125 in datadog-agent code | ||
| Name: DDDogstatsdPort, | ||
| Value: strconv.Itoa(dsdPortEnvVarValue), | ||
| }) |
There was a problem hiding this comment.
Preserve ADP-side DogStatsD config on non-delegating agents
This refactor hard-codes DogStatsD settings onto the Core Agent container, but for the !f.agentSupportsADPDelegation path we still explicitly disable Core DogStatsD (DD_USE_DOGSTATSD=false). In that version window (Agent < 7.75), the ADP container no longer receives direct DogStatsD config (port/socket/origin/tag-cardinality/mapper settings), so enabling data plane DogStatsD can leave ADP running with defaults while the Core server is turned off. Please keep routing config to AgentDataPlaneContainerName for non-delegating agents, or gate the Core-only behavior by delegation support.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3032 +/- ##
==========================================
+ Coverage 41.50% 42.24% +0.73%
==========================================
Files 335 337 +2
Lines 28714 29421 +707
==========================================
+ Hits 11919 12430 +511
- Misses 16001 16181 +180
- Partials 794 810 +16
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 10 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…s DSD When ADP is enabled and handling DogStatsD, the UDP port binding (including HostPort) must go to the agent-data-plane container, not the Core Agent. Previously the refactor to always set DSD env vars on Core Agent inadvertently moved the port binding too. This restores the correct behaviour: env vars go to Core Agent; the port binding goes to ADP when ADP is active. Also adds a unit test covering this. Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
4e1f3b4 to
fde94ea
Compare
…ntainer (#3032) (#3034) (cherry picked from commit efb068e) Co-authored-by: Toby Lawrence <[email protected]>
What does this PR do?
This PR updates the
dogstatsdfeature to set the relevant DSD-specific environment variables on the Core Agent container whether or not ADP is enabled.Motivation
Originally, based on how ADP worked, we needed to do the conditional split: add DSD settings directly on the ADP container when enabled. However, with ADP 1.0.0, this has changed: Core Agent authoritatively provides configuration to ADP, and so we want all configuration to be provided to the Core Agent, which then provides it to ADP.
As such, we need to move these environment variables back to the Core Agent container to ensure they flow to ADP as intended.
Additional Notes
Anything else we should know when reviewing?
Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
Describe your test plan
To be updated.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel