The Docker package is Linux-only and requires access to cgroup filesystem and Docker daemon.
Introduction
Thedocker package provides functionality to monitor Docker containers on Linux systems through cgroup interfaces. It allows you to retrieve container information, CPU statistics, and memory usage directly from the cgroup filesystem.
Key Features
Container Information
List all Docker containers with their status, image, and runtime information
CPU Statistics
Monitor CPU usage, user time, and system time for containers via cgroups
Memory Statistics
Track detailed memory metrics including RSS, cache, and page faults
Cgroup Support
Works with both Docker and systemd.slice cgroup hierarchies
Installation
Basic Usage
Error Types
The package defines specific error types for common failure scenarios:ErrDockerNotAvailable
Returned when the Docker daemon is not installed or not accessible.ErrCgroupNotAvailable
Returned when the cgroup filesystem is not available or accessible.Requirements
Architecture
The package reads data from two primary sources:- Docker CLI - Uses
docker pscommand to retrieve container metadata - Cgroup Filesystem - Reads
/sys/fs/cgroup/for performance metrics
Next Steps
Container Operations
Learn how to list and query Docker containers
Statistics
Monitor CPU and memory usage via cgroups