Skip to content

enable CNM direct send by default#3045

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 10 commits into
mainfrom
bryce.kahle/cnm-ds-default-true
Jun 5, 2026
Merged

enable CNM direct send by default#3045
gh-worker-dd-mergequeue-cf854d[bot] merged 10 commits into
mainfrom
bryce.kahle/cnm-ds-default-true

Conversation

@brycekahle

@brycekahle brycekahle commented May 26, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Enables CNM/USM direct send if agent version is >= 7.81.0

Motivation

Enabling direct send at the operator level first.

Additional Notes

  • Fixes environment variable not being set on process-agent container when Direct Send is disabled.
  • 7.81.0 is not yet released, but this is the first agent version that can support Direct Send regardless of node kernel version.

Minimum Agent Versions

  • Agent: v7.81.0
  • Cluster Agent: n/a

Describe your test plan

  • Add agent.datadoghq.com/cnm-direct-send-enabled=true annotation

    • With <7.80 ensure CNM direct send is NOT enabled:
      • DD_NETWORK_CONFIG_DIRECT_SEND=false
      • direct sender started log should NOT be present in system-probe logs.
      • process-agent container should be present
    • With 7.81+ ensure CNM direct is enabled:
      • DD_NETWORK_CONFIG_DIRECT_SEND=true
      • direct sender started log should be present in system-probe logs.
      • process-agent container should NOT be present
  • Set agent.datadoghq.com/cnm-direct-send-enabled=false annotation

    • With any agent version:
      • DD_NETWORK_CONFIG_DIRECT_SEND=false
      • direct sender started log should NOT be present in system-probe logs.
      • process-agent container should be present

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)

@brycekahle brycekahle added this to the v1.27.0 milestone May 26, 2026
@brycekahle brycekahle added the enhancement New feature or request label May 26, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented May 26, 2026

Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 44.40% (+0.46%)

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

@codecov-commenter

codecov-commenter commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.13%. Comparing base (19c5d3f) to head (13f2148).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3045      +/-   ##
==========================================
+ Coverage   43.62%   44.13%   +0.50%     
==========================================
  Files         349      352       +3     
  Lines       30057    30485     +428     
==========================================
+ Hits        13112    13454     +342     
- Misses      16075    16150      +75     
- Partials      870      881      +11     
Flag Coverage Δ
unittests 44.13% <100.00%> (+0.50%) ⬆️

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

Files with missing lines Coverage Δ
...nal/controller/datadogagent/feature/npm/feature.go 88.46% <100.00%> (+0.46%) ⬆️
...nal/controller/datadogagent/feature/usm/feature.go 84.31% <100.00%> (+0.64%) ⬆️
...nal/controller/datadogagent/feature/utils/utils.go 0.00% <ø> (ø)

... and 12 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

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

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

@brycekahle
brycekahle marked this pull request as ready for review May 26, 2026 22:51
@brycekahle
brycekahle requested a review from a team May 26, 2026 22:51
@brycekahle
brycekahle requested review from a team as code owners May 26, 2026 22:51
@brycekahle
brycekahle requested review from AmitaiBl and removed request for a team May 26, 2026 22:51

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

Copy link
Copy Markdown

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: f159b0bea8

ℹ️ 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".

const directSendMinVersion = "7.77.0-0"
defaultIfVersionUnknown := false
const directSendMinVersion = "7.81.0-0"
defaultIfVersionUnknown := true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Treat unknown agent versions as unsupported for direct send

Setting defaultIfVersionUnknown := true makes IsAboveMinVersion pass when the node-agent tag is unparsable (for example custom tags like latest or digest-based tags), so direct send remains enabled and the process-agent container is dropped by if !directSendEnabled. For deployments actually running <7.81.0 behind non-semver tags, this forces an unsupported data path and can break CNM/USM telemetry; the same fallback was also switched in feature/usm/feature.go, so unknown versions should continue to default to unsupported.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was intentional

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Moving the milestone to 1.28, as 1.27 will be released in a few days. This is a valid concern however: some people use latest in their manifest, so once 1.28 is released (in 5~ weeks), we need to make sure .81 is also released

@tbavelier tbavelier modified the milestones: v1.27.0, v1.28.0 May 27, 2026
@brycekahle
brycekahle force-pushed the bryce.kahle/cnm-ds-default-true branch from f159b0b to 1474588 Compare June 4, 2026 00:05

@tbavelier tbavelier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please include QA instructions: e.g. add the annotation set to true, verify XX, set the annotation to false, verify YY, remove the annotation, test with Agent version X.Y, verify that, test with Agent version X.Y+2, verify this

@brycekahle
brycekahle requested review from a team and AmitaiBl and removed request for a team and AmitaiBl June 4, 2026 20:38
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 5c6a923 into main Jun 5, 2026
53 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the bryce.kahle/cnm-ds-default-true branch June 5, 2026 21:25
tbavelier pushed a commit that referenced this pull request Jun 8, 2026
enable CNM direct send by default

fix default test

proper fix

add test for USM defaults if enabled

use annotation instead of CRD

re-generate

fix default

fix default test

fix process-agent apparmor

default to false for unknown versions


(cherry picked from commit 5c6a923)

Co-authored-by: Bryce Kahle <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants