---
title: Containerd
description: Track all your Containerd metrics with Datadog
breadcrumbs: Docs > Integrations > Containerd
---

# Containerd
Supported OS Integration version1.0.0
## Overview{% #overview %}

This check monitors the Containerd container runtime.

## Setup{% #setup %}

### Installation{% #installation %}

Containerd is a core [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) check. You must configure Containerd in both `datadog.yaml` and `containerd.d/conf.yaml`.

In `datadog.yaml`, configure your `cri_socket_path` for the Agent to query Containerd. In `containerd.d/conf.yaml`, configure the check instance settings (such as `filters`) for the events.

#### Installation on containers{% #installation-on-containers %}

If you are using the Agent in a container, setting the `DD_CRI_SOCKET_PATH` environment variable to the Containerd socket automatically enables the Containerd integration with the default configuration.

For example, to install the integration on Kubernetes, edit your DaemonSet to mount the Containerd socket from the host node to the Agent container and set the `DD_CRI_SOCKET_PATH` environment variable to the DaemonSet mount path:

{% tab title="Linux container" %}
##### Linux container{% #linux-container %}

```yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: datadog-agent
spec:
  template:
    spec:
      containers:
        - name: datadog-agent
          # ...
          env:
            - name: DD_CRI_SOCKET_PATH
              value: /var/run/containerd/containerd.sock
          volumeMounts:
            - name: containerdsocket
              mountPath: /var/run/containerd/containerd.sock
            - mountPath: /host/var/run
              name: var-run
              readOnly: true
          volumes:
            - hostPath:
                path: /var/run/containerd/containerd.sock
              name: containerdsocket
            - hostPath:
                path: /var/run
              name: var-run
```

**Note:** The `/var/run` directory must be mounted from the host to run the integration without issues.
{% /tab %}

{% tab title="Windows Container" %}
##### Windows container{% #windows-container %}

```yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: datadog-agent
spec:
  template:
    spec:
      containers:
        - name: datadog-agent
          # ...
          env:
            - name: DD_CRI_SOCKET_PATH
              value: \\\\.\\pipe\\containerd-containerd
          volumes:
            - hostPath:
                path: \\\\.\\pipe\\containerd-containerd
              name: containerdsocket
          volumeMounts:
            - name: containerdsocket
              mountPath: \\\\.\\pipe\\containerd-containerd
```

{% /tab %}

### Configuration{% #configuration %}

1. Edit the `containerd.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your Containerd performance data. See the [sample containerd.d/conf.yaml](https://github.com/DataDog/datadog-agent/blob/master/cmd/agent/dist/conf.d/containerd.d/conf.yaml.default) for all available configuration options.

1. [Restart the Agent](https://docs.datadoghq.com/help/)

### Validation{% #validation %}

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

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

### Metrics{% #metrics %}

Containerd collects metrics about the resource usage of your containers.

CPU, memory, block I/O, or huge page table metrics are collected out of the box. Additionally, you can also collect some disk metrics.

|  |
|  |
| **containerd.cpu.system**(gauge)              | The total CPU time*Shown as nanosecond*                        |
| **containerd.cpu.throttled.periods**(gauge)   | The total CPU throttled time (Linux only)*Shown as nanosecond* |
| **containerd.cpu.total**(gauge)               | The total CPU time*Shown as nanosecond*                        |
| **containerd.cpu.user**(gauge)                | The total user CPU time*Shown as nanosecond*                   |
| **containerd.image.pull**(count)              | The number of image pull requests*Shown as byte*               |
| **containerd.image.size**(gauge)              | The size of the container image*Shown as byte*                 |
| **containerd.mem.cache**(gauge)               | The cache amount used (Linux only)*Shown as byte*              |
| **containerd.mem.commit**(gauge)              | The committed memory (Windows only)*Shown as byte*             |
| **containerd.mem.commit\_peak**(gauge)        | The peak committed memory (Windows only)*Shown as byte*        |
| **containerd.mem.current.failcnt**(gauge)     | The usage failcnt (Linux only)                                 |
| **containerd.mem.current.limit**(gauge)       | The memory limit (Linux only)*Shown as byte*                   |
| **containerd.mem.current.usage**(gauge)       | The memory usage (Linux only)*Shown as byte*                   |
| **containerd.mem.kernel.usage**(gauge)        | The kernel usage (Linux only)*Shown as byte*                   |
| **containerd.mem.kernel\_tcp.failcnt**(gauge) | The kerneltcp failcnt (Linux only)                             |
| **containerd.mem.kernel\_tcp.limit**(gauge)   | The kerneltcp limit (Linux only)*Shown as byte*                |
| **containerd.mem.kernel\_tcp.max**(gauge)     | The kerneltcp maximum usage (Linux only)*Shown as byte*        |
| **containerd.mem.kernel\_tcp.usage**(gauge)   | The kerneltcp usage (Linux only)*Shown as byte*                |
| **containerd.mem.rss**(gauge)                 | The rss amount used (Linux only)*Shown as byte*                |
| **containerd.mem.swap.usage**(gauge)          | The swap usage (Linux only)*Shown as byte*                     |
| **containerd.mem.working\_set**(gauge)        | The container working set usage*Shown as byte*                 |
| **containerd.proc.open\_fds**(gauge)          | The number of open file descriptors*Shown as file*             |
| **containerd.storage.read**(rate)             | Read bytes (Windows only)*Shown as byte*                       |
| **containerd.storage.write**(rate)            | Write bytes (Windows only)*Shown as byte*                      |
| **containerd.uptime**(gauge)                  | Time since the container was started*Shown as second*          |

This integration works on Linux and Windows, but some metrics are OS dependent. Look at `metadata.csv` for the list of OS dependent metrics.

### Events{% #events %}

The Containerd check can collect events. Use `filters` to select the relevant events. See the [sample containerd.d/conf.yaml](https://github.com/DataDog/datadog-agent/blob/master/cmd/agent/dist/conf.d/containerd.d/conf.yaml.default) to have more details.

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

**containerd.health**

Returns `CRITICAL` if the Agent check is unable to connect to the monitored containerd socket. Returns `OK` otherwise.

*Statuses: ok, critical*

## Troubleshooting{% #troubleshooting %}

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