Dash0
Pricing
Docs
Login
Book a demoStart free trial
Dash0
Dash0 home

Company

  • About us
  • Careers
  • Trust Center
  • Brand
  • Security

Products

  • Observability
  • AI SDLC
  • Agent0
  • SignalStore
  • SignalControl

Resources

  • Blog
  • Guides
  • Knowledge
  • Comparisons
  • Documentation
  • Podcast
  • Newsletter
  • Ebook
  • Integrations
  • Changelog

Get Started

  • Pricing
  • Free trial
  • Sitemap
  • Glossary
  • OTelBin.io

Compare

  • Datadog
  • Grafana
  • Dynatrace
  • New Relic
  • Elastic
  • Honeycomb
  • Sentry
  • Splunk
  • Solarwinds
  • SigNoz
  • Chronosphere
  • Better Stack
  • Coralogix
  • Instana
System status
  • Terms and Conditions
  • Privacy Policy
  • Data Processing Agreement
  • Vulnerability Disclosure

Ship more. Break less.

© 2026 Dash0 Inc.

In this integration

  • Intro
  • Overview
  • Use Cases
  • Setup
  • Overview
  • Prerequisites
  • Run the Collector With Access to the Docker Socket
  • Collector Configuration
  • Configuration Options
  • Add Container Labels as Attributes
  • Enable Optional Metrics
  • Use Podman
  • Verification
  • References
  • Dashboards
  • Related integrations
Integrations/Docker

Docker

Monitor CPU, memory, network, and block I/O of Docker containers with the OpenTelemetry Collector Docker Stats receiver.

Overview

Docker runs applications in isolated containers that share the kernel of one host. Docker Compose and standalone Docker hosts run anything from a developer's local stack to production services on virtual machines and edge devices, often with several containers competing for the same CPU, memory, disk, and network.

When one container uses more than its share, the others slow down, and a container that reaches its memory limit is killed by the kernel. The OpenTelemetry Collector's Docker Stats receiver reads the Docker daemon's container stats API and reports CPU, memory, network, and block I/O metrics for every running container to Dash0, without an agent inside the containers. It also works with Podman through its Docker-compatible API.

Info

Running containers on Kubernetes? Use the Kubernetes integration instead. It collects container metrics from the kubelet together with pod, node, and workload context.

Use Cases

  • Monitor CPU and memory usage per container to find the containers that consume the most resources on a host.
  • Detect containers that approach their memory limit before the kernel's out-of-memory killer stops them.
  • Track network throughput and dropped packets per container to spot noisy neighbors and network problems.
  • Analyze block I/O read and write rates to find containers that saturate the host's disks.
  • Understand how CPU time splits between user mode and kernel mode to tell application work apart from system call and I/O overhead.

Setup

Overview

The OpenTelemetry Collector's Docker Stats receiver connects to the Docker daemon on the same host, through its Unix socket, and requests the stats of every running container at a fixed interval. It converts the stats into metrics with the container.* prefix and attaches the container's name, ID, image, and hostname as attributes. The collector then forwards these metrics to Dash0.

With the default configuration, the receiver reports these metrics:

  • CPU: container.cpu.usage.total, container.cpu.usage.usermode, container.cpu.usage.kernelmode (cumulative CPU time in nanoseconds), and container.cpu.utilization.
  • Memory: container.memory.usage.total (excluding the page cache), container.memory.usage.limit, and container.memory.percent (usage as a percentage of the limit). Depending on the cgroup version of the host, also container.memory.file (cgroup v2) or container.memory.total_cache (cgroup v1).
  • Network: container.network.io.usage.rx_bytes, container.network.io.usage.tx_bytes, container.network.io.usage.rx_dropped, and container.network.io.usage.tx_dropped, per network interface.
  • Block I/O: container.blockio.io_service_bytes_recursive, with the operation attribute set to read, write, and other operations.

More metrics, such as container.uptime, container.restarts, container.pids.count, and per-CPU usage, are available but disabled by default (see Enable Optional Metrics).

Prerequisites

Before setting up Docker monitoring, ensure:

  • Docker Engine is running on a Linux host, or Podman 4.7.0 or later exposes its Docker-compatible API socket.
  • The collector runs on the same host as the containers and can read the Docker socket, usually /var/run/docker.sock.
  • The collector runs the OpenTelemetry Collector Contrib distribution ↗, or a custom distribution that includes the Docker Stats receiver. The core distribution does not include it.

You'll need an OpenTelemetry Collector deployed on each Docker host. Running the collector as a container next to your other containers is the most common setup and is shown below.

Run the Collector With Access to the Docker Socket

Mount the Docker socket read-only into the collector container. The official collector images run as a non-root user, which cannot open the socket by default. Add the group that owns the socket on the host to the collector container, so the collector can read it without running as root.

Find the group ID of the socket on the Docker host:

stat -c '%g' /var/run/docker.sock

Then add the collector to your Docker Compose file, with that group ID in group_add:

services:
  otel-collector:
    image: otel/opentelemetry-collector-contrib:latest
    command: ["--config=/etc/otelcol/config.yaml"]
    group_add:
      - "999" # group ID of /var/run/docker.sock on the host
    volumes:
      - ./otelcol-config.yaml:/etc/otelcol/config.yaml:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro

Anyone who can read the Docker socket can control the Docker daemon. Keep the collector configuration under your control, and do not expose the collector's own ports beyond the networks that need them.

Collector Configuration

Add the Docker Stats receiver to your OpenTelemetry Collector configuration and wire it into a metrics pipeline:

receivers:
  docker_stats:
    endpoint: unix:///var/run/docker.sock
    collection_interval: 10s

processors:
  resourcedetection:
    detectors: [env, system]

service:
  pipelines:
    metrics:
      receivers: [docker_stats]
      processors: [resourcedetection]

The resourcedetection processor adds host.name to every metric, so you can tell containers on different Docker hosts apart. The Docker dashboard in this integration uses host.name for its Host filter.

Configuration Options

  • endpoint: Address of the Docker daemon. Default: unix:///var/run/docker.sock.
  • collection_interval: How often to request container stats. Default: 10s.
  • initial_delay: Delay before the first collection. Default: 1s.
  • timeout: Timeout for requests to the Docker daemon. Default: 5s.
  • api_version: Docker API version to use, as a string such as "1.44". Must be 1.25 or later. By default, the receiver negotiates the version with the daemon.
  • excluded_images: Images whose containers are not monitored. Entries can be exact names, globs such as "*/nginx*", or regular expressions between slashes. Prefix an entry with ! to negate it.
  • container_labels_to_metric_labels: Map of container labels to metric attributes.
  • env_vars_to_metric_labels: Map of container environment variables to metric attributes.
  • metrics: Enable or disable individual metrics.

For all available options, see the Docker Stats receiver documentation ↗.

Add Container Labels as Attributes

Docker Compose labels every container with its project and service name. Copy these labels to the metrics, so you can group and filter containers by Compose project and service in Dash0:

receivers:
  docker_stats:
    container_labels_to_metric_labels:
      com.docker.compose.project: docker.compose.project
      com.docker.compose.service: docker.compose.service

Enable Optional Metrics

Enable optional metrics in the metrics section of the receiver:

receivers:
  docker_stats:
    metrics:
      container.uptime:
        enabled: true
      container.restarts:
        enabled: true
      container.pids.count:
        enabled: true
      container.network.io.usage.rx_packets:
        enabled: true
      container.network.io.usage.tx_packets:
        enabled: true

Some memory and block I/O metrics are read from cgroup v1 statistics, such as container.memory.rss, container.memory.hierarchical_memory_limit, and container.blockio.io_serviced_recursive. Most current Linux distributions, Docker Desktop, and the Podman machine use cgroup v2, where the receiver does not report these metrics even when you enable them. Check docker info --format '{{.CgroupVersion}}' to see which version your host uses.

Use Podman

Podman serves a Docker-compatible API on its own socket. Find its address with podman info --format '{{.Host.RemoteSocket.Path}}', which prints a URI such as unix:///run/podman/podman.sock. Use the URI as the receiver's endpoint, or mount the socket file (the path after unix://) into the collector container at /var/run/docker.sock.

On hosts with SELinux enabled, including the Podman machine on macOS, SELinux blocks containers from opening the socket. Disable SELinux labeling for the collector container only:

services:
  otel-collector:
    security_opt:
      - label=disable

Verification

  1. Check the collector logs for errors from the docker_stats receiver.
  2. Navigate to the Metrics Explorer in Dash0.
  3. Search for metrics with the prefix container.*.
  4. Confirm that container.cpu.usage.total and container.memory.usage.total are reported with a container.name attribute for each running container.

References

  • OpenTelemetry Docker Stats Receiver Documentation ↗
  • Docker Runtime Metrics Documentation ↗
  • Podman: Docker-Compatible REST API ↗

Dashboards

Docker overview dashboard

Docker Overview

Docker dashboard covering running containers, CPU, memory usage and limits, network throughput, dropped packets, and block I/O per container

  • containers
  • docker
  • podman

Related Integrations

  • OpenTelemetry Collector
  • Host Metrics (OpenTelemetry)