Skip to content

argo_workflows: add container-based config discovery support - #24886

Open
vitkyrka wants to merge 4 commits into
masterfrom
claude/argo-workflows-config-discovery-eb0089
Open

argo_workflows: add container-based config discovery support#24886
vitkyrka wants to merge 4 commits into
masterfrom
claude/argo-workflows-config-discovery-eb0089

Conversation

@vitkyrka

@vitkyrka vitkyrka commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds Kubernetes container-based config discovery support to argo_workflows, the first integration to combine config discovery with the repo's new Kubernetes Agent E2E backend (#24639, #24827).

The port is taken from the metrics named container port.

The AD identifier workflow-controller is a generic name that could be used by something even not from Argo, so a CEL selector narrows the image reference further down to something that contains argoproj/workflow-controller.

This also ports two pieces of shared, integration-agnostic infrastructure needed to make this work on the new Kubernetes Agent backend:

  • A from_named_ports discovery strategy and its discovery/openmetrics_from_named_ports template (datadog_checks_dev), matching the existing from_ports strategy but keyed by container port name instead of number.
  • A generic Kubernetes discovery-stability E2E helper (datadog_checks_dev/dev/kubernetes.py), which asserts a target workload pod stays stable while every generated discovery candidate is probed, and delegates check execution to the existing dd_agent_check/dd_agent_check_discovery fixtures rather than spinning up a separate Agent pod.

Motivation

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

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 87.00%
Overall Coverage: 88.62% (+0.10%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5d766eb | Docs | View more details | Give us feedback!

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 17, 2026

Copy link
Copy Markdown

evalya-impact-summary

evalya impact analysis
Impact analysis: 0 selected, 0 skipped (of 0 test tasks)
Publish tasks:   1 (always emitted)
Diff (18 files):
  argo_workflows/assets/configuration/spec.yaml
  argo_workflows/changelog.d/24886.added
  argo_workflows/datadog_checks/argo_workflows/config_models/discovery.py
  argo_workflows/datadog_checks/argo_workflows/config_models/discovery_overrides.py
  argo_workflows/datadog_checks/argo_workflows/config_models/discovery_strategies.py
  argo_workflows/datadog_checks/argo_workflows/data/auto_conf.yaml
  argo_workflows/pyproject.toml
  argo_workflows/tests/conftest.py
  argo_workflows/tests/test_e2e.py
  datadog_checks_dev/changelog.d/24886.added
  datadog_checks_dev/datadog_checks/dev/kubernetes.py
  datadog_checks_dev/datadog_checks/dev/tooling/configuration/discovery/core_strategies.py
  datadog_checks_dev/datadog_checks/dev/tooling/configuration/discovery/registry.py
  datadog_checks_dev/datadog_checks/dev/tooling/configuration/spec.py
  datadog_checks_dev/datadog_checks/dev/tooling/templates/configuration/discovery/openmetrics_from_named_ports.yaml
  datadog_checks_dev/tests/test_kubernetes.py
  datadog_checks_dev/tests/tooling/configuration/consumers/model/test_discovery.py
  datadog_checks_dev/tests/tooling/configuration/test_load.py

Debug a specific task: evalya plan impact --path <path> --task <task>

Learn more about CI impact filtering

@vitkyrka
vitkyrka force-pushed the claude/argo-workflows-config-discovery-eb0089 branch 2 times, most recently from 39a6537 to ab4ef17 Compare August 17, 2026 10:47

Copy link
Copy Markdown
Contributor Author

@codex review

@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: ab4ef17161

ℹ️ 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 datadog_checks_dev/datadog_checks/dev/kubernetes.py Outdated
vitkyrka and others added 4 commits August 18, 2026 10:20
Ports the generic discovery-strategy spec-tooling (a `from_named_ports`
strategy and its `discovery/openmetrics_from_named_ports` template) and
a generic Kubernetes discovery-stability E2E harness
(`datadog_checks_dev/dev/kubernetes.py`), then wires up argo_workflows
to use them: a discovery block and `auto_conf.yaml` file entry in
spec.yaml, regenerated config models, an `auto_conf` metadata key in
the E2E fixture so the Kubernetes Agent backend mounts the discovery
template, and new discovery E2E tests. Bumps the `datadog-checks-base`
floor to >=38.0.0 for `candidate_ports_by_name`.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…overy_candidates_stable_kubernetes

Flagged by Codex review: the top-level Kubernetes discovery-stability
helper's container_name= argument was only exercised indirectly via
the private _build_service_from_pod helper, not end-to-end through
the public function.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Vincent Whitchurch <vincent.whitchurch@datadoghq.com>
Addresses the two findings from the automated Codex review on PR #24886:

- _build_service_from_pod built a bare SimpleNamespace host string, so
  IPv6 pod IPs produced malformed, unbracketed URLs in generated
  discovery candidates (and since candidate errors are swallowed by the
  stability-check loop, this could pass silently). Wrap the host in a
  small local Host-like class that brackets IPv6 literals for URL
  templates, mirroring datadog_checks.base.utils.discovery.Host without
  taking a dependency on datadog_checks_base (not a declared dependency
  of datadog_checks_dev).
- The array[string] strategy-input validator accepted `port_names: []`
  or blank-string entries, which pass spec validation but make
  candidate_ports_by_name yield zero candidates at runtime, silently.
  Require at least one non-empty string.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vitkyrka
vitkyrka force-pushed the claude/argo-workflows-config-discovery-eb0089 branch from ab4ef17 to 5d766eb Compare August 18, 2026 08:20

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 5d766ebc57

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

@dd-octo-sts

dd-octo-sts Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

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.

2 participants