Skip to content

enable discovery by default on supported agent versions#2598

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 9 commits into
mainfrom
guillaume.pagnoux/service-discovery-defaulting
Apr 30, 2026
Merged

enable discovery by default on supported agent versions#2598
gh-worker-dd-mergequeue-cf854d[bot] merged 9 commits into
mainfrom
guillaume.pagnoux/service-discovery-defaulting

Conversation

@Yumasi

@Yumasi Yumasi commented Apr 24, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

This PR enables Service Discovery by default on agents >=7.78, which will use the new System-Probe-Lite binary for low-resource overhead. The version is determined based on the image tag. We treat every unparseable tag as "latest". This is to be consistent with the operator behaviour.

The change makes the distinction between default enablement, and an explicit one. This allows users of an agent <7.78 to still enable discovery if they truly wants it, via system-probe (much higher overhead).

Which issue this PR fixes

DSCVR-396

Special notes for your reviewer:

This PR uses the fallback mechanism of System-Probe to decide to start System-Probe-Lite. This is done in order to avoid a drift between the Helm chart & the agent in the handling of the fallback decision (i.e we would have to maintain a list of system-probe feature which could be easily missed when adding new features. Missing it could cause wrong behaviors like not enabling system-probe when we actually should for another feature, for example).

Using system-probe to control the fallback decision, like in bare-Linux & Docker installations, avoid this sort of issues, but this means that we will see a spike in memory consumption due to system-probe's size itself (~70MiB). Once the fallback to System-Probe-Lite happens, the memory use is expected to fallback to ~3.4MiB (measured in dogfooding).

Fallback behaviour + system-probe container creation tested with Kind and the following cases:

Agent version Config scenario system-probe
container status
Running binary
master-py3 Default configuration, non-semver tag fallback Present System-Probe-Lite
latest Default configuration, chart get-agent-version policy Present System-Probe-Lite
7.78 Default configuration Present System-Probe-Lite
7.77 Default configuration Absent N/A
7.78 Discovery explicitly disabled Absent N/A
7.77 Discovery explicitly enabled Present System-Probe
7.78 Other system-probe feature enabled Present System-Probe

Checklist

  • All commits are signed and show as "Verified" on GitHub (see: signing commits)
  • Chart Version semver bump label has been added (use <chartName>/minor-version, <chartName>/patch-version, or <chartName>/no-version-bump)
  • For datadog or datadog-operator chart or value changes, update the test baselines (run: make update-test-baselines)
  • For datadog chart changes, received ✅ from a member of your team

GitHub CI takes care of the below, but are still required:

  • Documentation has been updated with helm-docs (run: .github/helm-docs.sh)
  • CHANGELOG.md has been updated
  • Variables are documented in the README.md

@Yumasi Yumasi added the datadog/minor-version Minor version bump for datadog chart label Apr 24, 2026
@Yumasi
Yumasi marked this pull request as ready for review April 24, 2026 09:38
@Yumasi
Yumasi requested review from a team as code owners April 24, 2026 09:38
@Yumasi
Yumasi requested a review from a team April 24, 2026 09:41

@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: 86e657310d

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread charts/datadog/templates/_helpers.tpl
@Yumasi
Yumasi force-pushed the guillaume.pagnoux/service-discovery-defaulting branch from 86e6573 to 3818a56 Compare April 24, 2026 09:43

@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: 3818a56ce9

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread charts/datadog/templates/_helpers.tpl Outdated
@Yumasi
Yumasi marked this pull request as draft April 24, 2026 09:54
@Yumasi
Yumasi force-pushed the guillaume.pagnoux/service-discovery-defaulting branch from 3818a56 to 4ba7ff3 Compare April 24, 2026 12:42
@Yumasi

Yumasi commented Apr 24, 2026

Copy link
Copy Markdown
Member Author

@codex review

…vice-discovery-defaulting

# Conflicts:
#	test/datadog/baseline/manifests/gke_autopilot_usm.yaml
#	test/datadog/baseline/manifests/usm_daemonset_default.yaml
@github-actions

github-actions Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

⚠️ GKE Autopilot / GDC Baseline Manifests Changed

This PR modifies GKE Autopilot or GDC baseline manifest snapshots. Before merging, confirm:

  • GKE Autopilot/GKE GDC baseline manifest diffs have been reviewed and confirmed to be supported in GKE Autopilot and the latest Datadog WorkloadAllowlist.

If changes introduce constraints not yet covered by the Datadog WorkloadAllowlist CR, gate them with {{- if not (or .Values.providers.gke.autopilot .Values.providers.gke.gdc) }} until the WorkloadAllowlist is updated.
See gke-constraints-review-guide.md for the full constraint reference.

@github-actions github-actions Bot added the chart/datadog This issue or pull request is related to the datadog chart label Apr 24, 2026
- bump version for datadog to 3.202.0 (minor-version)
- update changelog for datadog with version 3.202.0
- update readme for datadog
@Yumasi
Yumasi marked this pull request as ready for review April 24, 2026 13:03
Comment thread charts/datadog/templates/_helpers.tpl Outdated
@Yumasi
Yumasi requested review from a team as code owners April 30, 2026 13:22
@Yumasi
Yumasi requested review from gpalmz and removed request for a team April 30, 2026 13:22
@github-actions github-actions Bot added the chart/observability-pipelines-worker This issue or pull request is related to the observability-pipelines-worker chart label Apr 30, 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: f4b4faa67d

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread charts/datadog/templates/_helpers.tpl
@gh-worker-ownership-write-b05516
gh-worker-ownership-write-b05516 Bot removed the request for review from a team April 30, 2026 13:42
@Yumasi
Yumasi force-pushed the guillaume.pagnoux/service-discovery-defaulting branch from 40871f3 to f4b4faa Compare April 30, 2026 13:45
@Yumasi Yumasi added observability-pipelines-worker/no-version-bump Skip version bump for observability-pipelines-worker chart observability-pipelines-worker/patch-version Patch version bump for observability-pipelines-worker chart and removed observability-pipelines-worker/no-version-bump Skip version bump for observability-pipelines-worker chart labels Apr 30, 2026
dd-octo-sts Bot added 3 commits April 30, 2026 13:47
- bump version for observability-pipelines-worker to 2.15.5 (patch-version)
- update changelog for observability-pipelines-worker with version 2.15.5
- update readme for observability-pipelines-worker
- update readme for observability-pipelines-worker
- update readme for observability-pipelines-worker
@Yumasi

Yumasi commented Apr 30, 2026

Copy link
Copy Markdown
Member Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Apr 30, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-04-30 15:06:52 UTC ℹ️ Start processing command /merge


2026-04-30 15:06:58 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 53m (p90).


2026-04-30 15:55:05 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 9285c65 into main Apr 30, 2026
42 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the guillaume.pagnoux/service-discovery-defaulting branch April 30, 2026 15:55
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request May 12, 2026
#2643)

[datadog] auto-enable discovery on `latest` and `7` tags

The `get-agent-version` fallback substituted `7.67.0` for the
single-component tags `latest` and `7`, which is below the `>=7.78.0`
threshold that auto-enables service discovery (introduced in #2598). As
a result, users on these floating tags never got a system-probe
container or `system-probe-lite`, despite the actual `latest` image
supporting it.

Bump the fallback to `7.78.0` so the chart treats `latest`/`7` like the
current agent and auto-enables discovery with `system-probe-lite`.

[datadog] expand 3.209.0 CHANGELOG entry to match PR scope

The fallback bump affects several version-gated code paths besides
discovery (ADP, -fips-full, standalone DDOT FIPS, DD_USE_DOGSTATSD).
Reword the changelog so it matches the release note in the PR
description.

Merge remote-tracking branch 'origin/main' into vitkyrka/disco-latest

# Conflicts:
#	charts/datadog/CHANGELOG.md

Merge remote-tracking branch 'origin/main' into vitkyrka/disco-latest

# Conflicts:
#	charts/datadog/CHANGELOG.md
#	charts/datadog/Chart.yaml
#	charts/datadog/README.md

Co-authored-by: vincent.whitchurch <[email protected]>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/datadog-agent that referenced this pull request May 12, 2026
### What does this PR do?

Adds a Kubernetes E2E sanity test for the Datadog Agent's discovery feature, mirroring (in spirit) the existing Linux VM suite in `test/new-e2e/tests/discovery/linux_test.go`. The new suite at `test/new-e2e/tests/discovery/k8s_test.go`:

- Provisions a Kind-on-EC2 cluster (`provkindvm`) with the agent installed via Helm and an `nginx` workload.
- Runs `TestNginxDiscovered` in two sub-tests covering both discovery modes:
  - `system-probe-lite` — discovery enabled alone; the agent execs into `system-probe-lite` per `cmd/system-probe/subcommands/run/splite.go`.
  - `system-probe` — adds `datadog.systemProbe.enableOOMKill: true` so the agent's `shouldExecSPLite` keeps the full binary running.
- Asserts on the matched nginx process: TCP port 80 listener, `ServiceDiscovery.GeneratedServiceName == {nginx, SOURCE_COMMAND_LINE}`, `ApmInstrumentation == false`, `InjectionState == NOT_INJECTED`, non-empty `ContainerId`.
- Pins the Helm chart version to `3.213.0`; the framework default (`3.155.1`) predates both the discovery template (chart 3.205.0, DataDog/helm-charts#2598) and the `latest`/`7` → `7.78.x` fallback fix (chart 3.213.0, DataDog/helm-charts#2643).

### Motivation

https://datadoghq.atlassian.net/browse/DSCVR-385

There is no k8s e2e for discovery today. DataDog/helm-charts#2634 fixed a bug in discovery on k8s related to the seccomp profile; the change went undetected before merge because nothing exercises the discovery flow on a Helm-installed agent. This suite closes that gap with a smoke-level check that the discovery payload reaches fakeintake in both modes.

The k8s suite is narrower than `linux_test.go` (single workload, smoke-level assertions), at least for now. This is to avoid having to add new app definitions at this point for a basic test. The VM suite continues to be the exhaustive per-language source of truth.

### Describe how you validated your changes

Ran locally against AWS twice with `E2E_DEV_MODE=true dda inv -- -e new-e2e-tests.run --targets ./tests/discovery --run TestK8sTestSuite --stack-name-suffix v2`:

```
--- PASS: TestK8sTestSuite (364.64s)
    --- PASS: TestK8sTestSuite/TestNginxDiscovered (...)
        --- PASS: TestK8sTestSuite/TestNginxDiscovered/system-probe-lite
        --- PASS: TestK8sTestSuite/TestNginxDiscovered/system-probe
```

Lint: `golangci-lint run ./test/new-e2e/tests/discovery/...` clean (0 issues).

### Additional Notes

A few quirks worth flagging for reviewers:

- **Forced DaemonSet rollout via pod annotation.** Toggling `datadog.systemProbe.enableOOMKill` between sub-tests only mutates the chart-rendered configmap; the chart's `daemonset.yaml` has no `checksum/system-probe-yaml` annotation tying the pod template to that configmap, so the existing pod stays alive across the change. The suite writes a `agents.podAnnotations.discovery-e2e-mode: "spl"/"sp"` that intentionally differs per sub-test to bump the pod-template hash and force a rollout.
- **Tracer metadata / language detection out of scope.** Nginx is C/native so `language` and `serviceDiscovery.tracerMetadata` aren't populated. The two natural ways to extend this — switch to (or add) an OTel-instrumented Go server (`apps-calendar-go` — no `K8sAppDefinition` yet) or a `dd-trace-go`-instrumented app (`apps-tracegen` predates the memfd-tracer-metadata feature in `dd-trace-go.v1`) — both require cross-repo work in `test-infra-definitions`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: vincent.whitchurch <[email protected]>
chouetz pushed a commit to DataDog/datadog-agent that referenced this pull request May 13, 2026
### What does this PR do?

Adds a Kubernetes E2E sanity test for the Datadog Agent's discovery feature, mirroring (in spirit) the existing Linux VM suite in `test/new-e2e/tests/discovery/linux_test.go`. The new suite at `test/new-e2e/tests/discovery/k8s_test.go`:

- Provisions a Kind-on-EC2 cluster (`provkindvm`) with the agent installed via Helm and an `nginx` workload.
- Runs `TestNginxDiscovered` in two sub-tests covering both discovery modes:
  - `system-probe-lite` — discovery enabled alone; the agent execs into `system-probe-lite` per `cmd/system-probe/subcommands/run/splite.go`.
  - `system-probe` — adds `datadog.systemProbe.enableOOMKill: true` so the agent's `shouldExecSPLite` keeps the full binary running.
- Asserts on the matched nginx process: TCP port 80 listener, `ServiceDiscovery.GeneratedServiceName == {nginx, SOURCE_COMMAND_LINE}`, `ApmInstrumentation == false`, `InjectionState == NOT_INJECTED`, non-empty `ContainerId`.
- Pins the Helm chart version to `3.213.0`; the framework default (`3.155.1`) predates both the discovery template (chart 3.205.0, DataDog/helm-charts#2598) and the `latest`/`7` → `7.78.x` fallback fix (chart 3.213.0, DataDog/helm-charts#2643).

### Motivation

https://datadoghq.atlassian.net/browse/DSCVR-385

There is no k8s e2e for discovery today. DataDog/helm-charts#2634 fixed a bug in discovery on k8s related to the seccomp profile; the change went undetected before merge because nothing exercises the discovery flow on a Helm-installed agent. This suite closes that gap with a smoke-level check that the discovery payload reaches fakeintake in both modes.

The k8s suite is narrower than `linux_test.go` (single workload, smoke-level assertions), at least for now. This is to avoid having to add new app definitions at this point for a basic test. The VM suite continues to be the exhaustive per-language source of truth.

### Describe how you validated your changes

Ran locally against AWS twice with `E2E_DEV_MODE=true dda inv -- -e new-e2e-tests.run --targets ./tests/discovery --run TestK8sTestSuite --stack-name-suffix v2`:

```
--- PASS: TestK8sTestSuite (364.64s)
    --- PASS: TestK8sTestSuite/TestNginxDiscovered (...)
        --- PASS: TestK8sTestSuite/TestNginxDiscovered/system-probe-lite
        --- PASS: TestK8sTestSuite/TestNginxDiscovered/system-probe
```

Lint: `golangci-lint run ./test/new-e2e/tests/discovery/...` clean (0 issues).

### Additional Notes

A few quirks worth flagging for reviewers:

- **Forced DaemonSet rollout via pod annotation.** Toggling `datadog.systemProbe.enableOOMKill` between sub-tests only mutates the chart-rendered configmap; the chart's `daemonset.yaml` has no `checksum/system-probe-yaml` annotation tying the pod template to that configmap, so the existing pod stays alive across the change. The suite writes a `agents.podAnnotations.discovery-e2e-mode: "spl"/"sp"` that intentionally differs per sub-test to bump the pod-template hash and force a rollout.
- **Tracer metadata / language detection out of scope.** Nginx is C/native so `language` and `serviceDiscovery.tracerMetadata` aren't populated. The two natural ways to extend this — switch to (or add) an OTel-instrumented Go server (`apps-calendar-go` — no `K8sAppDefinition` yet) or a `dd-trace-go`-instrumented app (`apps-tracegen` predates the memfd-tracer-metadata feature in `dd-trace-go.v1`) — both require cross-repo work in `test-infra-definitions`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

Labels

chart/datadog This issue or pull request is related to the datadog chart chart/observability-pipelines-worker This issue or pull request is related to the observability-pipelines-worker chart datadog/minor-version Minor version bump for datadog chart mergequeue-status: done observability-pipelines-worker/patch-version Patch version bump for observability-pipelines-worker chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants