Skip to content

[Backport v1.27] fix(dogstatsd): always set DSD environment variables on Core Agent container#3034

Merged
tbavelier merged 1 commit into
v1.27from
backport-3032-to-v1.27
May 21, 2026
Merged

[Backport v1.27] fix(dogstatsd): always set DSD environment variables on Core Agent container#3034
tbavelier merged 1 commit into
v1.27from
backport-3032-to-v1.27

Conversation

@dd-octo-sts
Copy link
Copy Markdown

@dd-octo-sts dd-octo-sts Bot commented May 21, 2026

Backport efb068e from #3032.


What does this PR do?

This PR updates the dogstatsd feature 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?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

To be updated.

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

@dd-octo-sts dd-octo-sts Bot requested a review from a team as a code owner May 21, 2026 11:56
@dd-octo-sts dd-octo-sts Bot added the bug Something isn't working label May 21, 2026
@dd-octo-sts dd-octo-sts Bot requested a review from a team as a code owner May 21, 2026 11:56
@dd-octo-sts dd-octo-sts Bot added backport label added by backport action bot label added by backport bot team/agent-metric-pipelines labels May 21, 2026
@dd-octo-sts dd-octo-sts Bot added this to the v1.27.0 milestone May 21, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +237 to +239
if f.dataPlaneEnabled && f.dataPlaneDogstatsdEnabled {
portContainerName = apicommon.AgentDataPlaneContainerName
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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-commenter
Copy link
Copy Markdown

codecov-commenter commented May 21, 2026

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 41.37%. Comparing base (8e158b7) to head (ef15977).

Files with missing lines Patch % Lines
...ntroller/datadogagent/feature/dogstatsd/feature.go 94.73% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           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           
Flag Coverage Δ
unittests 41.37% <94.73%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ntroller/datadogagent/feature/dogstatsd/feature.go 75.00% <94.73%> (+2.27%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e158b7...ef15977. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@datadog-prod-us1-3
Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 95.00%
Overall Coverage: 41.70% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ef15977 | Docs | Datadog PR Page | Give us feedback!

@tbavelier tbavelier merged commit 1607b6c into v1.27 May 21, 2026
59 checks passed
@tbavelier tbavelier deleted the backport-3032-to-v1.27 branch May 21, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport label added by backport action bot label added by backport bot bug Something isn't working team/agent-metric-pipelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants