﻿---
title: Docker (OpenTelemetry)
description: This input package enables collection of telemetry data from Docker containers through OpenTelemetry protocols using the dockerstats receiver. It provides...
url: https://www.elastic.co/docs/reference/integrations/docker_input_otel
products:
  - Elastic integrations
applies_to:
  - Serverless Observability projects: Preview
  - Serverless Security projects: Preview
  - Elastic Stack: Preview since 9.2
---

# Docker (OpenTelemetry)
|                                                                                                 |                                                                   |
|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| **Version**                                                                                     | 0.1.2 <applies-to>: Preview</applies-to> ([View all](#changelog)) |
| **Subscription level**[What's this?](https://www.elastic.co/subscriptions)                      | Basic                                                             |
| **Developed by**[What's this?](https://www.elastic.co/docs/reference/integrations/developed-by) | Elastic                                                           |
| **Minimum Kibana version(s)**                                                                   | 9.2.0                                                             |

<admonition title="The Docker (OpenTelemetry) integration v0.1.2 is in technical preview">
  To use pre-release integrations, go to the **Integrations** page in Kibana, scroll down, and toggle on the _Display beta integrations_ option.
</admonition>


## Overview

This input package enables collection of telemetry data from Docker containers through OpenTelemetry protocols using the [dockerstats receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/dockerstatsreceiver). It provides comprehensive metrics about container resource usage including CPU, memory, network, and block I/O statistics.

### How it works

This package receives telemetry data from the Docker daemon by configuring the Docker endpoint in the Input Package, which then gets applied to the `docker_stats` receiver present in the EDOT collector, which then forwards the data to Elastic Agent. The Elastic Agent processes and enriches the data before sending it to Elasticsearch for indexing and analysis. Once the data arrives into Elasticsearch, its corresponding [Docker OpenTelemetry Assets Package](https://www.elastic.co/docs/reference/integrations/docker_otel) gets auto installed and the dashboards light up.

## Requirements

- Access to the Docker daemon socket (default: `unix:///var/run/docker.sock` on Linux and `npipe:////./pipe/docker_engine` on Windows)
- Docker API version greater than or equal to the one defined in [Docker Stats Receiver Repo](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/dockerstatsreceiver). Also, the API version must be supported by the Docker Engine being monitored.


## Compatibility

This integration uses the OpenTelemetry dockerstats receiver which is currently in **alpha** stability. The configuration and metrics may change between versions.

## Setup

For step-by-step instructions on how to set up an integration, see the [Getting started](https://www.elastic.co/guide/en/starting-with-the-elasticsearch-platform-and-its-solutions/current/getting-started-observability.html) guide.

## Configuration

The following configuration options are available:

### Docker Endpoint

The endpoint of the Docker daemon. If not specified, the receiver uses `unix:///var/run/docker.sock` on Linux.
For remote Docker hosts, you can use TCP endpoints like `tcp://docker-host:2375`.

### Excluded Images

A list of container image names to exclude from metrics collection. Supports wildcards.
Example:
```yaml
- "nginx:*"
- "redis:latest"
```


### API Version

The Docker API version to use. Default is `"1.44"`.
For Docker Engine v29, API version `"1.44"` or higher must be used.

### Initial Delay

Defines how long this receiver waits before starting. Default is `1s`.

### Container Labels to Metric Labels

Map container labels to metric resource attributes. This allows you to add custom dimensions to your metrics based on container labels.
Example:
```yaml
my.container.label: my_metric_label
app.version: version
```


### Environment Variables to Metric Labels

Map container environment variables to metric resource attributes.
Example:
```yaml
MY_ENV_VAR: my_metric_label
APP_VERSION: version
```


### Metrics

For a complete list of all available metrics, including their types, descriptions, and default enabled status, refer to the [Docker Stats Receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/dockerstatsreceiver/documentation.md) in the upstream OpenTelemetry Collector repository.
The `metrics` configuration allows you to enable optional metrics or disable default metrics.
For example, to enable per-CPU usage metrics (which are disabled by default):
```yaml
metrics:
  container.cpu.usage.percpu:
    enabled: true
```


## Additional Resources

- [OpenTelemetry dockerstats receiver documentation](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/dockerstatsreceiver)
- [Docker Stats API documentation](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerStats)
- [Elastic Observability documentation](https://www.elastic.co/guide/en/observability/current/index.html)


## Changelog

<dropdown title="Changelog">
  | Version   | Details                                                                                                                                                        | Minimum Kibana version |
  |-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|
  | **0.1.2** | **Enhancement** ([View pull request](https://github.com/elastic/integrations/pull/20550))Add group field to package manifest.                                  | 9.2.0                  |
  | **0.1.1** | **Enhancement** ([View pull request](https://github.com/elastic/integrations/pull/19526))Update package title and description to improve clarity of use.       | 9.2.0                  |
  | **0.1.0** | **Enhancement** ([View pull request](https://github.com/elastic/integrations/pull/17372))Initial technical preview of Docker Stats OpenTelemetry input package | 9.2.0                  |
</dropdown>