Prometheus metrics collectors for Podman containers on OpenWrt, designed for use with prometheus-node-exporter-lua.
- Container Metrics: State, info, timestamps, exit codes, restart counts
- Pod Metrics: State, container counts, metadata
- Image Metrics: Size, creation time, metadata
- Network & Volume Metrics: Configuration and metadata
- System Metrics: Podman version, API version, runtime info
- Per-Container Stats: CPU, memory, network I/O, block I/O, PIDs
- Low Overhead: Optimized API calls (~300ms basic, ~200ms stats)
- Native Unix Socket: Direct communication via
/run/podman/podman.sock
| Package | Overhead | Description |
|---|---|---|
prometheus-node-exporter-lua-podman |
~300ms | Basic metrics for containers, pods, images, networks, volumes, system |
prometheus-node-exporter-lua-podman-container |
~200ms | Per-container resource stats (CPU, memory, network, block I/O) |
- OpenWrt 24.10.x
- Podman with API socket enabled
prometheus-node-exporter-lua
You can setup the package feed to install and update with opkg:
https://github.com/Zerogiven-OpenWRT-Packages/package-feed
Download from the Releases page:
opkg update
opkg install prometheus-node-exporter-lua-podman_*.ipk
opkg install prometheus-node-exporter-lua-podman-container_*.ipkgit clone https://github.com/Zerogiven-OpenWRT-Packages/prometheus-node-exporter-lua-podman.git package/prometheus-node-exporter-lua-podman
make menuconfig # Navigate to: Utilities → prometheus-node-exporter-lua-podman
make package/prometheus-node-exporter-lua-podman/compile V=sAfter installation, the collectors are automatically available. Ensure Podman is running:
/etc/init.d/podman start
/etc/init.d/podman enableMetrics are available at the standard node exporter endpoint:
http://your-router-ip:9100/metrics
If collectors don't appear in the default scrape, explicitly request them:
scrape_configs:
- job_name: 'openwrt'
params:
collect:
- podman
- podman-container
static_configs:
- targets: ['router:9100']| Metric | Type | Description |
|---|---|---|
podman_container_info |
gauge | Container metadata (image, name, id, ports, pod) |
podman_container_state |
gauge | Container state as numeric value |
podman_container_created_seconds |
gauge | Container creation timestamp |
podman_container_started_seconds |
gauge | Container start timestamp |
podman_container_exited_seconds |
gauge | Container exit timestamp |
podman_container_exit_code |
gauge | Container exit code |
podman_container_restarts_total |
counter | Number of container restarts |
| Metric | Type | Description |
|---|---|---|
podman_pod_info |
gauge | Pod metadata |
podman_pod_state |
gauge | Pod state as numeric value |
podman_pod_containers |
gauge | Number of containers in pod |
podman_pod_created_seconds |
gauge | Pod creation timestamp |
| Metric | Type | Description |
|---|---|---|
podman_image_info |
gauge | Image metadata |
podman_image_size_bytes |
gauge | Image size |
podman_network_info |
gauge | Network metadata (driver, interface) |
podman_volume_info |
gauge | Volume metadata |
podman_system_api_version |
gauge | Podman API version |
| Metric | Type | Description |
|---|---|---|
podman_container_cpu_seconds_total |
counter | CPU time consumed |
podman_container_cpu_system_seconds_total |
counter | System CPU time |
podman_container_mem_usage_bytes |
gauge | Current memory usage |
podman_container_mem_limit_bytes |
gauge | Memory limit |
podman_container_pids |
gauge | Number of processes |
podman_container_block_input_total |
counter | Block I/O read bytes |
podman_container_block_output_total |
counter | Block I/O write bytes |
podman_container_net_input_total |
counter | Network received bytes |
podman_container_net_output_total |
counter | Network transmitted bytes |
Container states are mapped to numeric values for Prometheus:
| State | Value |
|---|---|
| unknown | -1 |
| created | 0 |
| initialized | 1 |
| running | 2 |
| stopped | 3 |
| paused | 4 |
| exited | 5 |
| removing | 6 |
| stopping | 7 |
- prometheus-node-exporter-lua - OpenWrt metrics framework
- prometheus-podman-exporter
- Podman - Container runtime