[Backport v1.27] fix(dogstatsd): always set DSD environment variables on Core Agent container#3034
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef15977505
ℹ️ 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".
| if f.dataPlaneEnabled && f.dataPlaneDogstatsdEnabled { | ||
| portContainerName = apicommon.AgentDataPlaneContainerName | ||
| } |
There was a problem hiding this comment.
Preserve DogStatsD port binding in single-container mode
When global.containerStrategy is single, ManageSingleContainerNodeAgent calls manageNodeAgent with unprivileged-single-agent, but this branch unconditionally rewrites the port target to agent-data-plane whenever Data Plane DogStatsD is enabled. In real reconciliation, AddPortToContainer only mutates existing containers, so on single-container pods (no agent-data-plane container) the DogStatsD ContainerPort/HostPort is dropped entirely, which regresses the previous behavior and breaks DogStatsD host-port exposure for that configuration.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v1.27 #3034 +/- ##
=======================================
Coverage 41.36% 41.37%
=======================================
Files 334 334
Lines 28586 28581 -5
=======================================
Hits 11826 11826
+ Misses 15970 15965 -5
Partials 790 790
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
🎯 Code Coverage (details) 🔗 Commit SHA: ef15977 | Docs | Datadog PR Page | Give us feedback! |
Backport efb068e from #3032.
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