Skip to content

[Backport v1.29] Add Dynamic Instrumentation system probe feature (#3245)#3252

Merged
levan-m merged 2 commits into
v1.29from
backport-3245-to-v1.29
Jul 13, 2026
Merged

[Backport v1.29] Add Dynamic Instrumentation system probe feature (#3245)#3252
levan-m merged 2 commits into
v1.29from
backport-3245-to-v1.29

Conversation

@levan-m

@levan-m levan-m commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator
  • Add Dynamic Instrumentation system probe feature

Adds spec.features.dynamicInstrumentation.enabled to the DatadogAgent CRD and a dyninst feature handler that turns it into the pod-spec changes system-probe needs (HostPID, capabilities, procdir/cgroups/ debugfs/socket volumes, and the DD_DYNAMIC_INSTRUMENTATION_ENABLED / DD_SYSTEM_PROBE_ENABLED env vars). Enabling the flag pulls in the system-probe container automatically rather than requiring a separate toggle.

This intentionally omits the node-scoped remote-config path and per-node DatadogAgentProfile management from the earlier draft of this work: Dynamic Instrumentation will only ever be enabled cluster-wide, and services move between nodes too often for node-level targeting to make sense. Delivery of the flag itself (remote, controlled rollout with rollback) is handled by Fleet Automation's existing operator experiment mechanism, which patches this same spec field directly, so no bespoke remote-config wiring is needed here.

  • Mount a writable state dir for the DI system-probe module

system-probe runs with a read-only root filesystem, and the dyninst feature handler didn't mount anywhere for the Dynamic Instrumentation module's own writable state (the debugger-probes tombstone file and the SymDB upload cache), so the module had nowhere to write.

The path matters here: it needs to match run_path/system-probe/ dynamic-instrumentation, not /tmp/datadog-agent/system-probe/ dynamic-instrumentation, since datadog-agent#53286 just moved this state out of /tmp for a security fix (world-writable /tmp was a symlink-attack vector). Mounting at the old /tmp path would satisfy nothing, since the module doesn't write there anymore.

Adds a dedicated emptyDir volume for this, mounted only on the system-probe container, at a path derived from the same RunPathVolume Mount constant logcollection already uses for its own run-path mount, so it stays in sync if that base path ever changes.

Verified with go build, go vet, and go test across the datadogagent and datadogagentinternal controller packages, including updating dyninst's own feature test to expect the new volume/mount. Confirmed none of the renderer golden-file fixtures needed updating, since none of them enable dynamicInstrumentation (they only render its default off value).

(cherry picked from commit eb07514)

What does this PR do?

A brief description of the change being made with this pull request.

Motivation

What inspired you to submit this pull request?

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

Write there any instructions and details you may have to test your PR.

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)

* Add Dynamic Instrumentation system probe feature

Adds spec.features.dynamicInstrumentation.enabled to the DatadogAgent
CRD and a dyninst feature handler that turns it into the pod-spec
changes system-probe needs (HostPID, capabilities, procdir/cgroups/
debugfs/socket volumes, and the DD_DYNAMIC_INSTRUMENTATION_ENABLED /
DD_SYSTEM_PROBE_ENABLED env vars). Enabling the flag pulls in the
system-probe container automatically rather than requiring a separate
toggle.

This intentionally omits the node-scoped remote-config path and
per-node DatadogAgentProfile management from the earlier draft of this
work: Dynamic Instrumentation will only ever be enabled cluster-wide,
and services move between nodes too often for node-level targeting to
make sense. Delivery of the flag itself (remote, controlled rollout
with rollback) is handled by Fleet Automation's existing operator
experiment mechanism, which patches this same spec field directly, so
no bespoke remote-config wiring is needed here.

* Mount a writable state dir for the DI system-probe module

system-probe runs with a read-only root filesystem, and the dyninst
feature handler didn't mount anywhere for the Dynamic Instrumentation
module's own writable state (the debugger-probes tombstone file and
the SymDB upload cache), so the module had nowhere to write.

The path matters here: it needs to match run_path/system-probe/
dynamic-instrumentation, not /tmp/datadog-agent/system-probe/
dynamic-instrumentation, since datadog-agent#53286 just moved this
state out of /tmp for a security fix (world-writable /tmp was a
symlink-attack vector). Mounting at the old /tmp path would satisfy
nothing, since the module doesn't write there anymore.

Adds a dedicated emptyDir volume for this, mounted only on the
system-probe container, at a path derived from the same RunPathVolume
Mount constant logcollection already uses for its own run-path mount,
so it stays in sync if that base path ever changes.

Verified with go build, go vet, and go test across the datadogagent
and datadogagentinternal controller packages, including updating
dyninst's own feature test to expect the new volume/mount. Confirmed
none of the renderer golden-file fixtures needed updating, since none
of them enable dynamicInstrumentation (they only render its default
off value).

(cherry picked from commit eb07514)
@levan-m levan-m added this to the v1.29.0 milestone Jul 13, 2026
@levan-m
levan-m requested review from a team as code owners July 13, 2026 08:36
@levan-m levan-m added enhancement New feature or request qa/skip-qa backport label added by backport action labels Jul 13, 2026

@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: 256d8c7530

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

// USM (Universal Service Monitoring) configuration.
USM *USMFeatureConfig `json:"usm,omitempty"`
// DynamicInstrumentation configuration.
DynamicInstrumentation *DynamicInstrumentationFeatureConfig `json:"dynamicInstrumentation,omitempty"`

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 Regenerate the OLM bundle CRDs for the new field

Adding this served API field only updates config/crd, but the shipped OLM bundle schemas were not regenerated: rg dynamicInstrumentation bundle/manifests returns no matches for datadoghq.com_datadogagents.yaml, datadogagentinternals.yaml, or datadogagentprofiles.yaml. Clusters installed from the bundle/OperatorHub will therefore not have spec.features.dynamicInstrumentation in their CRD schema, so the API server can drop or reject the field and users cannot enable the new feature through that installation path.

Useful? React with 👍 / 👎.

@datadog-prod-us1-6

This comment has been minimized.

@levan-m
levan-m merged commit 22a7857 into v1.29 Jul 13, 2026
34 of 35 checks passed
@levan-m
levan-m deleted the backport-3245-to-v1.29 branch July 13, 2026 13:45
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.

3 participants