---
title: Amazon VPC CNI
description: >-
  Monitor the Amazon VPC CNI plugin for Kubernetes, tracking IP address
  allocation, ENI usage, and AWS API activity.
breadcrumbs: Docs > Integrations > Amazon VPC CNI
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Amazon VPC CNI
Supported OS Integration version0.1.0
{% callout %}
# Important note for users on the following Datadog sites: us2.ddog-gov.com

{% alert level="info" %}
To find out if this integration is available in your organization, see your [Datadog Integrations](https://app.datadoghq.com/integrations) page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email [support@ddog-gov.com](mailto:support@ddog-gov.com).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

The [Amazon VPC CNI plugin for Kubernetes](https://github.com/aws/amazon-vpc-cni-k8s) 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{% #setup %}

### Installation{% #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](https://docs.datadoghq.com/agent/guide/use-community-integrations.md) to install checks with the [Agent Manager](https://docs.datadoghq.com/agent/guide/agent-commands.md?tab=agentv6v7#start-stop-and-restart-the-agent) or in a [Docker environment](https://docs.datadoghq.com/agent/guide/use-community-integrations.md?tab=docker).

1. [Download and launch the Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest).

1. Run the following command to install the Agent integration:

   ```shell
   datadog-agent integration install -t datadog-amazon-vpc-cni==<INTEGRATION_VERSION>
   ```

1. Configure your integration in the same way as core [integrations](https://docs.datadoghq.com/getting_started/integrations.md).

### Configuration{% #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](https://docs.datadoghq.com/agent/guide/agent-configuration-files.md#agent-configuration-directory) to start collecting your Amazon VPC CNI metrics. See the [sample amazon_vpc_cni.d/conf.yaml](https://github.com/DataDog/integrations-extras/blob/master/amazon_vpc_cni/datadog_checks/amazon_vpc_cni/data/conf.yaml.example) for all available configuration options.

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands.md#start-stop-and-restart-the-agent).

### Validation{% #validation %}

[Run the Agent's status subcommand](https://docs.datadoghq.com/agent/guide/agent-commands.md#agent-status-and-information) and look for `amazon_vpc_cni` under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **amazon_vpc_cni.ipamd_action_inprogress**(gauge)                             | The number of ipamd actions in progress.                                                         |
| **amazon_vpc_cni.eni_max**(gauge)                                              | The maximum number of ENIs that can be attached to the instance (accounting for unmanaged ENIs). |
| **amazon_vpc_cni.ip_max**(gauge)                                               | The maximum number of IP addresses that can be allocated to the instance.                        |
| **amazon_vpc_cni.eni_allocated**(gauge)                                        | The number of ENIs allocated.                                                                    |
| **amazon_vpc_cni.total_ip_addresses**(gauge)                                  | The total number of IP addresses.                                                                |
| **amazon_vpc_cni.assigned_ip_addresses**(gauge)                               | The number of IP addresses assigned to pods.                                                     |
| **amazon_vpc_cni.total_ipv4_prefixes**(gauge)                                 | The total number of IPv4 prefixes.                                                               |
| **amazon_vpc_cni.assigned_ip_per_cidr**(gauge)                               | The total number of IP addresses assigned per CIDR.                                              |
| **amazon_vpc_cni.assigned_ip_per_eni**(gauge)                                | The number of allocated IPs partitioned by ENI.                                                  |
| **amazon_vpc_cni.connmark_backend**(gauge)                                     | The connmark backend in use; the active backend series is set to 1.                              |
| **amazon_vpc_cni.ipamd_error_count.count**(count)                             | The number of errors encountered in ipamd.                                                       |
| **amazon_vpc_cni.reconcile_count.count**(count)                                | The number of times ipamd reconciles on ENIs and IP/Prefix addresses.                            |
| **amazon_vpc_cni.add_ip_req_count.count**(count)                             | The number of add IP address requests.                                                           |
| **amazon_vpc_cni.del_ip_req_count.count**(count)                             | The number of delete IP address requests.                                                        |
| **amazon_vpc_cni.pod_eni_error_count.count**(count)                          | The number of errors encountered for pod ENIs.                                                   |
| **amazon_vpc_cni.aws_api_error_count.count**(count)                          | The number of times AWS API returns an error.                                                    |
| **amazon_vpc_cni.aws_utils_error_count.count**(count)                        | The number of errors not handled in the awsutils library.                                        |
| **amazon_vpc_cni.ec2api_req_count.count**(count)                              | The number of requests made to EC2 APIs by the CNI.                                              |
| **amazon_vpc_cni.ec2api_error_count.count**(count)                            | The number of failed EC2 API requests.                                                           |
| **amazon_vpc_cni.sagemakerapi_req_count.count**(count)                        | The number of requests made to SageMaker APIs by the CNI.                                        |
| **amazon_vpc_cni.sagemakerapi_error_count.count**(count)                      | The number of failed SageMaker API requests.                                                     |
| **amazon_vpc_cni.force_removed_enis.count**(count)                            | The number of ENIs force removed while they had assigned pods.                                   |
| **amazon_vpc_cni.force_removed_ips.count**(count)                             | The number of IPs force removed while they had assigned pods.                                    |
| **amazon_vpc_cni.no_available_ip_addresses.count**(count)                    | The number of pod IP assignments that fail due to no available IP addresses.                     |
| **amazon_vpc_cni.connmark_reconcile_total.count**(count)                      | The number of connmark reconciliations by result.                                                |
| **amazon_vpc_cni.aws_api_latency_ms.count**(count)                           | Number of AWS API latency observations.                                                          |
| **amazon_vpc_cni.aws_api_latency_ms.sum**(count)                             | Sum of AWS API call latencies.*Shown as millisecond*                                             |
| **amazon_vpc_cni.ipamd_startup_duration_seconds.count**(count)               | Number of IPAMD startup duration observations.                                                   |
| **amazon_vpc_cni.ipamd_startup_duration_seconds.sum**(count)                 | Sum of IPAMD startup durations.*Shown as second*                                                 |
| **amazon_vpc_cni.ipamd_startup_duration_seconds.bucket**(count)              | Histogram buckets of IPAMD startup durations.                                                    |
| **amazon_vpc_cni.ipamd_node_initialization_duration_seconds.count**(count)  | Number of node initialization duration observations.                                             |
| **amazon_vpc_cni.ipamd_node_initialization_duration_seconds.sum**(count)    | Sum of node initialization durations.*Shown as second*                                           |
| **amazon_vpc_cni.ipamd_node_initialization_duration_seconds.bucket**(count) | Histogram buckets of node initialization durations.                                              |

### Service Checks{% #service-checks %}

**amazon_vpc_cni.openmetrics.health**

Returns `CRITICAL` if the Agent is unable to connect to the Amazon VPC CNI OpenMetrics endpoint, otherwise returns `OK`.

*Statuses: ok, critical*

### Events{% #events %}

The Amazon VPC CNI integration does not include any events.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).

## Further Reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [GitHub - aws/amazon-vpc-cni-k8s: Networking plugin repository for pod networking in Kubernetes using Elastic Network Interfaces on AWS](https://github.com/aws/amazon-vpc-cni-k8s)
