-
Notifications
You must be signed in to change notification settings - Fork 859
feat(amazon-vpc-cni): add new integration for Amazon VPC CNI #3159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
willianccs
wants to merge
14
commits into
DataDog:master
Choose a base branch
from
willianccs:feat/amazon-vpc-cni
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3110fee
feat(amazon-vpc-cni): add new integration for Amazon VPC CNI
2862d17
fix(amazon-vpc-cni): serve mock metrics at /metrics for integration t…
1a95ba2
Add CODEOWNERS entry for Amazon VPC CNI
63720d8
Add Amazon VPC CNI to test-all matrix
193eda3
Merge branch 'master' into feat/amazon-vpc-cni
willianccs 7ac8e88
Merge branch 'master' into feat/amazon-vpc-cni
willianccs fa6472d
fix(amazon-vpc-cni): address code review feedback
47ed8b1
Update amazon_vpc_cni/README.md
willianccs 774b200
Merge branch 'master' into feat/amazon-vpc-cni
willianccs ce0680b
fix(amazon-vpc-cni): address Agent review feedback
42462bd
fix(amazon-vpc-cni): flush monotonic counters in e2e test
a94f988
Merge branch 'master' into feat/amazon-vpc-cni
willianccs 579a99f
Update amazon_vpc_cni/README.md
willianccs 2112a43
Merge branch 'master' into feat/amazon-vpc-cni
willianccs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # CHANGELOG - Amazon VPC CNI | ||
|
|
||
| ## 0.1.0 / 2026-09-15 | ||
|
|
||
| ***Added***: | ||
|
|
||
| * Initial release of the Amazon VPC CNI integration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Agent Check: Amazon VPC CNI | ||
|
|
||
| ## Overview | ||
|
|
||
| The [Amazon VPC CNI plugin for Kubernetes][13] is the networking plugin deployed on each Amazon EC2 node in an Amazon EKS cluster. It manages elastic network interfaces (ENIs) and assigns private IPv4 or IPv6 addresses from the VPC to each pod. | ||
|
|
||
| This integration scrapes the Prometheus metrics exposed by the VPC CNI plugin (`awscni_*`) and provides visibility into IP address allocation, ENI usage, AWS API activity, and IPAMD health. It lets you replace ad-hoc `awscni_*` custom metrics with an official, curated integration. | ||
|
|
||
| ## Setup | ||
|
|
||
| ### Installation | ||
|
|
||
| If you are using Datadog Agent v6.8+, follow the instructions below to install the Amazon VPC CNI check on your host. See the dedicated Agent guide for [installing community integrations][1] to install checks with the [Agent Manager][2] or in a [Docker environment][4]. | ||
|
|
||
| 1. [Download and launch the Datadog Agent][3]. | ||
| 2. Run the following command to install the Agent integration: | ||
|
|
||
| ```shell | ||
| datadog-agent integration install -t datadog-amazon-vpc-cni==<INTEGRATION_VERSION> | ||
| ``` | ||
|
|
||
| 3. Configure your integration in the same way as core [integrations][5]. | ||
|
|
||
| ### Configuration | ||
|
|
||
| Metrics are enabled by default on the `aws-node` DaemonSet. To control them, set the environment variable `DISABLE_METRICS` to `false`. The plugin exposes metrics at `http://localhost:61678/metrics` on each node. | ||
|
|
||
| Because the `aws-node` DaemonSet runs with host networking, `localhost` only resolves to the IPAMD endpoint when the Agent also runs with host networking (or directly on the node). If the Agent runs as a pod without host networking, set `openmetrics_endpoint` to the node's IP address, for example `http://<NODE_IP>:61678/metrics`, or use Autodiscovery to resolve the node address. | ||
|
|
||
| 1. Edit the `amazon_vpc_cni.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory][6] to start collecting your Amazon VPC CNI metrics. See the [sample amazon_vpc_cni.d/conf.yaml][7] for all available configuration options. | ||
|
|
||
| 2. [Restart the Agent][8]. | ||
|
|
||
| ### Validation | ||
|
|
||
| [Run the Agent's status subcommand][9] and look for `amazon_vpc_cni` under the Checks section. | ||
|
|
||
| ## Data Collected | ||
|
|
||
| ### Metrics | ||
|
|
||
| See [metadata.csv][10] for a list of metrics provided by this integration. | ||
|
|
||
| ### Service Checks | ||
|
|
||
| See [service_checks.json][11] for a list of service checks provided by this integration. | ||
|
|
||
| ### Events | ||
|
|
||
| The Amazon VPC CNI integration does not include any events. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| Need help? Contact [Datadog support][12]. | ||
|
|
||
| [1]: https://docs.datadoghq.com/agent/guide/use-community-integrations/ | ||
| [2]: https://docs.datadoghq.com/agent/guide/agent-commands/?tab=agentv6v7#start-stop-and-restart-the-agent | ||
| [3]: /account/settings/agent/latest | ||
| [4]: https://docs.datadoghq.com/agent/guide/use-community-integrations/?tab=docker | ||
| [5]: https://docs.datadoghq.com/getting_started/integrations/ | ||
| [6]: https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory | ||
| [7]: https://github.com/DataDog/integrations-extras/blob/master/amazon_vpc_cni/datadog_checks/amazon_vpc_cni/data/conf.yaml.example | ||
| [8]: https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent | ||
| [9]: https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information | ||
| [10]: https://github.com/DataDog/integrations-extras/blob/master/amazon_vpc_cni/metadata.csv | ||
| [11]: https://github.com/DataDog/integrations-extras/blob/master/amazon_vpc_cni/assets/service_checks.json | ||
| [12]: https://docs.datadoghq.com/help/ | ||
| [13]: https://github.com/aws/amazon-vpc-cni-k8s | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: Amazon VPC CNI | ||
| files: | ||
| - name: amazon_vpc_cni.yaml | ||
| options: | ||
| - template: init_config | ||
| options: | ||
| - template: init_config/default | ||
| - template: instances | ||
| options: | ||
| - template: instances/openmetrics | ||
| overrides: | ||
| openmetrics_endpoint.value.example: http://localhost:61678/metrics | ||
|
willianccs marked this conversation as resolved.
|
||
| openmetrics_endpoint.description: | | ||
| Endpoint exposing the Amazon VPC CNI Prometheus metrics. | ||
|
|
||
| The `aws-node` DaemonSet runs with host networking, so `localhost` only | ||
| resolves to the IPAMD endpoint when the Agent also runs with host | ||
| networking (or directly on the node host). If the Agent runs as a pod | ||
| without host networking, set this to the node's IP address, for example | ||
| `http://<NODE_IP>:61678/metrics`, or use Autodiscovery with a template | ||
| that resolves the node address. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| [ | ||
| { | ||
| "agent_version": "7.59.0", | ||
| "integration": "Amazon VPC CNI", | ||
| "check": "amazon_vpc_cni.openmetrics.health", | ||
| "statuses": ["ok", "critical"], | ||
| "groups": ["host", "endpoint"], | ||
| "name": "Amazon VPC CNI OpenMetrics endpoint health", | ||
| "description": "Returns `CRITICAL` if the Agent is unable to connect to the Amazon VPC CNI OpenMetrics endpoint, otherwise returns `OK`." | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| __path__ = __import__('pkgutil').extend_path(__path__, __name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| __version__ = '0.1.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| from .__about__ import __version__ | ||
| from .check import AmazonVpcCniCheck | ||
|
|
||
| __all__ = ['__version__', 'AmazonVpcCniCheck'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| from datadog_checks.base import OpenMetricsBaseCheckV2 | ||
|
|
||
| from .metrics import METRIC_MAP | ||
|
|
||
|
|
||
| class AmazonVpcCniCheck(OpenMetricsBaseCheckV2): | ||
| __NAMESPACE__ = 'amazon_vpc_cni' | ||
| DEFAULT_METRIC_LIMIT = 0 | ||
|
|
||
| def get_default_config(self): | ||
| return { | ||
| 'metrics': [METRIC_MAP], | ||
| } |
20 changes: 20 additions & 0 deletions
20
amazon_vpc_cni/datadog_checks/amazon_vpc_cni/config_models/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # This file is autogenerated. | ||
| # To change this file you should edit assets/configuration/spec.yaml and then run the following commands: | ||
| # ddev -x validate config -s <INTEGRATION_NAME> | ||
| # ddev -x validate models -s <INTEGRATION_NAME> | ||
|
|
||
| from .instance import InstanceConfig | ||
| from .shared import SharedConfig | ||
|
|
||
|
|
||
| class ConfigMixin: | ||
| _config_model_instance: InstanceConfig | ||
| _config_model_shared: SharedConfig | ||
|
|
||
| @property | ||
| def config(self) -> InstanceConfig: | ||
| return self._config_model_instance | ||
|
|
||
| @property | ||
| def shared_config(self) -> SharedConfig: | ||
| return self._config_model_shared |
124 changes: 124 additions & 0 deletions
124
amazon_vpc_cni/datadog_checks/amazon_vpc_cni/config_models/defaults.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| # This file is autogenerated. | ||
| # To change this file you should edit assets/configuration/spec.yaml and then run the following commands: | ||
| # ddev -x validate config -s <INTEGRATION_NAME> | ||
| # ddev -x validate models -s <INTEGRATION_NAME> | ||
|
|
||
|
|
||
| def instance_allow_redirects(): | ||
| return True | ||
|
|
||
|
|
||
| def instance_auth_type(): | ||
| return 'basic' | ||
|
|
||
|
|
||
| def instance_cache_metric_wildcards(): | ||
| return True | ||
|
|
||
|
|
||
| def instance_cache_shared_labels(): | ||
| return True | ||
|
|
||
|
|
||
| def instance_collect_counters_with_distributions(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_collect_histogram_buckets(): | ||
| return True | ||
|
|
||
|
|
||
| def instance_disable_generic_tags(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_empty_default_hostname(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_enable_health_service_check(): | ||
| return True | ||
|
|
||
|
|
||
| def instance_enable_legacy_tags_normalization(): | ||
| return True | ||
|
|
||
|
|
||
| def instance_histogram_buckets_as_distributions(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_ignore_connection_errors(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_kerberos_auth(): | ||
| return 'disabled' | ||
|
|
||
|
|
||
| def instance_kerberos_delegate(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_kerberos_force_initiate(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_log_requests(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_min_collection_interval(): | ||
| return 15 | ||
|
|
||
|
|
||
| def instance_non_cumulative_histogram_buckets(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_persist_connections(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_request_size(): | ||
| return 16 | ||
|
|
||
|
|
||
| def instance_skip_proxy(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_tag_by_endpoint(): | ||
| return True | ||
|
|
||
|
|
||
| def instance_telemetry(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_timeout(): | ||
| return 10 | ||
|
|
||
|
|
||
| def instance_tls_ignore_warning(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_tls_use_host_header(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_tls_verify(): | ||
| return True | ||
|
|
||
|
|
||
| def instance_use_latest_spec(): | ||
| return False | ||
|
|
||
|
|
||
| def instance_use_legacy_auth_encoding(): | ||
| return True | ||
|
|
||
|
|
||
| def instance_use_process_start_time(): | ||
| return False |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.