Skip to content

feat(amazon-vpc-cni): add new integration for Amazon VPC CNI - #3159

Open
willianccs wants to merge 14 commits into
DataDog:masterfrom
willianccs:feat/amazon-vpc-cni
Open

willianccs wants to merge 14 commits into
DataDog:masterfrom
willianccs:feat/amazon-vpc-cni

Conversation

@willianccs

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a new Agent-based integration for the Amazon VPC CNI plugin for Kubernetes.

The check scrapes the Prometheus metrics exposed by the VPC CNI plugin (awscni_*) and maps them to amazon_vpc_cni.*, covering IP address allocation, ENI usage, IPAMD activity, AWS API calls, and startup duration.

Motivation

These metrics are currently collected as kube_system.awscni_* custom metrics, incurring custom metric billing. This integration promotes them to an official, curated integration.

Review checklist

  • PR has a meaningful title
  • Feature has tests
  • Git history is clean

Additional Notes

Metrics sourced from the VPC CNI plugin's Prometheus endpoint (port 61678), enabled via ENABLE_PROMETHEUS_METRICS=true.

@willianccs
willianccs requested a review from a team as a code owner September 15, 2026 09:39
@buraizu buraizu added the editorial review Waiting on a more in-depth review from a docs team editor label Sep 15, 2026
@buraizu

buraizu commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR! I've created DOCS-15717 for documentation team review.

@willianccs
willianccs requested a review from a team as a code owner September 15, 2026 17:22
Comment thread amazon_vpc_cni/datadog_checks/amazon_vpc_cni/metrics.py Outdated
Comment thread amazon_vpc_cni/tests/test_unit.py
Comment thread .github/CODEOWNERS Outdated
Comment thread amazon_vpc_cni/metadata.csv Outdated
Comment thread amazon_vpc_cni/datadog_checks/amazon_vpc_cni/check.py Outdated
Comment thread amazon_vpc_cni/datadog_checks/amazon_vpc_cni/metrics.py
Comment thread amazon_vpc_cni/tests/test_e2e.py Outdated
@lucia-sb

Copy link
Copy Markdown

Thanks for the PR! I left a few comments below.

Comment legend

request: a change I believe is necessary before merging.
suggestion: optional improvement, recommended but not required.
question: seeking clarification or understanding your approach.
nit: minor, non-blocking (style, typo). Feel free to ignore.
praise: no action needed, just celebrate!

willianccs and others added 2 commits September 18, 2026 23:33
- Fix connmark_reconcile mapping (prometheus_client strips the _total suffix)
- Strengthen unit test assertions (at_least=1, check_symmetric_inclusion)
- Restore @DataDog/ecosystems-review on CODEOWNERS entries and add it to amazon_vpc_cni
- Correct duration sub-metric units in metadata.csv
- Simplify check.py (drop unused V1-only config and pass-through overrides)
- Add missing sagemaker metrics for full parity
- Remove unused mock fixture from e2e tests
@willianccs
willianccs requested a review from lucia-sb September 19, 2026 03:06
joepeeples
joepeeples previously approved these changes Sep 22, 2026

@joepeeples joepeeples left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved with small edit suggestion, thanks!

Comment thread amazon_vpc_cni/README.md Outdated
Co-authored-by: Joe Peeples <joe.peeples@datadoghq.com>
@temporal-github-worker-1
temporal-github-worker-1 Bot dismissed joepeeples’s stale review September 22, 2026 18:10

Review from joepeeples is dismissed. Related teams and files:

  • documentation
    • amazon_vpc_cni/README.md
@willianccs

Copy link
Copy Markdown
Contributor Author

@lucia-sb could you check again please? Thank you!

joepeeples
joepeeples previously approved these changes Sep 24, 2026
@ian28223
ian28223 requested review from a team and bgoldberg122 and removed request for a team September 25, 2026 06:19
@ian28223

Copy link
Copy Markdown
Contributor

Requested review from ecosystems-review as per Merge Gate

@Wyrine Wyrine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agent: Requesting changes for the setup and validation findings below. The earlier metric-map, unit-test, and metadata-unit fixes are present in this revision.

I checked the implementation against the upstream AWS exporter and inspected the passing CI results, including Agent E2E tests against the static HTTP fixture. I did not run a live EKS deployment. Please address the Kubernetes endpoint instructions and exporter toggle, align the latency fixture/metadata with actual exporter output, and strengthen the remaining E2E metric assertions.

options:
- template: instances/openmetrics
overrides:
openmetrics_endpoint.value.example: http://localhost:61678/metrics

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agent: [P2] Document a reachable endpoint for Kubernetes Agents

Could you document an Autodiscovery or node-address configuration, and explain that localhost only works when the Agent shares the node network? AWS's aws-node DaemonSet uses hostNetwork, while an Agent pod without host networking resolves localhost to its own pod. Following the current example in that deployment therefore fails to reach IPAMD and collects no metrics. Please update the README and generated example consistently. AWS DaemonSet configuration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in ce0680b. The openmetrics_endpoint description now covers the host-networking caveat in both spec.yaml and the generated conf.yaml.example, and the README Configuration section explains that localhost only resolves when the Agent shares the node network, pointing to node-IP / Autodiscovery alternatives.

Comment thread amazon_vpc_cni/README.md
3. Configure your integration in the same way as core [integrations][5].

### Configuration

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agent: [P2] Use the supported AWS metrics toggle

Could you replace ENABLE_PROMETHEUS_METRICS=true with the documented DISABLE_METRICS=false setting and mention that metrics are enabled by default? AWS documents DISABLE_METRICS as the IPAMD endpoint control; the variable given here will not re-enable the endpoint on a deployment that has DISABLE_METRICS=true. AWS configuration reference.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in ce0680b. README now uses DISABLE_METRICS=false and states metrics are enabled by default.

awscni_pod_eni_error_count{fn="podENIHandler"} 4
# HELP awscni_aws_api_latency_ms AWS API call latency in ms
# TYPE awscni_aws_api_latency_ms summary
awscni_aws_api_latency_ms{api="DescribeNetworkInterfaces",error="false",status="200",quantile="0.5"} 15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agent: [P2] Match the latency fixture and metadata to actual exporter output

These quantile samples make the test pass for amazon_vpc_cni.aws_api_latency_ms.quantile, but upstream creates AwsAPILatency with Name/Help and no Objectives. The Prometheus Go client's default is an empty Objectives map, which emits count/sum without quantiles. Could you use representative exporter output in both fixture copies and remove the unsupported quantile expectation/metadata row, unless a supported CNI version can be shown to emit it? Otherwise the integration advertises a metric users cannot receive. AWS summary definition, Prometheus summary options.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in ce0680b. Removed the quantile samples from both fixture copies and dropped the aws_api_latency_ms.quantile row from metadata.csv and the test expectations, so only .count/.sum are advertised for the summary.

Comment thread amazon_vpc_cni/tests/test_e2e.py Outdated
dd_agent_check(instance)

for metric in EXPECTED_PROMETHEUS_METRICS:
aggregator.assert_metric(metric, at_least=0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agent: [P2] Require metrics to be emitted in the Agent E2E test

The unit-test assertions were strengthened, but this Agent-side test still uses at_least=0. That succeeds even when an expected metric has no samples, and the subsequent coverage/metadata checks do not require every expected metric to exist. Could you use at_least=1 here and check_symmetric_inclusion=True in the metadata assertion, as in the unit test, so an Agent-only collection regression fails this test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in ce0680b. E2E now asserts at_least=1 and uses check_symmetric_inclusion=True in the metadata assertion.

- Document node-reachability caveat for openmetrics_endpoint and use DISABLE_METRICS=false toggle
- Remove unsupported aws_api_latency_ms.quantile from fixtures and metadata
- Strengthen e2e metric assertions (at_least=1, symmetric inclusion)
@temporal-github-worker-1
temporal-github-worker-1 Bot dismissed joepeeples’s stale review September 28, 2026 17:47

Review from joepeeples is dismissed. Related teams and files:

  • documentation
    • amazon_vpc_cni/README.md
    • amazon_vpc_cni/metadata.csv
OpenMetrics V2 counters are not emitted on the first scrape (flush_first_value),
so a single dd_agent_check run produced no *.count metrics. Run with rate=True,
matching the gatekeeper/aerospike_enterprise pattern, so counters flush.
@willianccs
willianccs requested a review from Wyrine September 28, 2026 18:51
@willianccs

Copy link
Copy Markdown
Contributor Author

@Wyrine could you review again please ?

Comment thread amazon_vpc_cni/README.md Outdated
willianccs and others added 2 commits October 1, 2026 13:30
Co-authored-by: bgoldberg122 <ben.goldberg@datadoghq.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editorial review Waiting on a more in-depth review from a docs team editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants