Skip to content

Support container metric collection for Quadlets (Podman via Systemd)#38

Open
plexus wants to merge 1 commit into
c0m4r:mainfrom
plexus:quadlet-support
Open

Support container metric collection for Quadlets (Podman via Systemd)#38
plexus wants to merge 1 commit into
c0m4r:mainfrom
plexus:quadlet-support

Conversation

@plexus

@plexus plexus commented Jul 18, 2026

Copy link
Copy Markdown

When running as quadlet, the cgroup directory uses a different naming format than plain libpod/podman. Instead, resolve the cgroup path via /proc/<pid>/cgroup. The container PID was already resolved via a docker inspect call in readNetIO, this has been hoisted into a separate containerPid function.

Podman actually exposes the cgroup directory directly in the API, but docker does not, which is why I went with this approach.

The fallback case where no socket/API is available has been amended as well to scan for quadlet-style
paths (cgroup/system.slice/.service/libpod-payload-).

This was written with the help of Deepseek V4 Pro. I tried to keep it minimal. I diagnosed the issue myself first, and I reviewed and tested the code afterwards.

When running as quadlet, the cgroup directory uses a different naming format
than plain libpod/podman. Instead, resolve the cgroup path via
`/proc/<pid>/cgroup`. The container PID was already resolved via a docker
inspect call in `readNetIO`, this has been hoisted into a separate
`containerPid` function.

The fallback case where no socket/API is available has been amended as well to
scan for quadlet-style
paths (cgroup/system.slice/<unit>.service/libpod-payload-<id>).
@plexus
plexus force-pushed the quadlet-support branch from 453a37c to e71add9 Compare July 21, 2026 10:22
@plexus

plexus commented Jul 21, 2026

Copy link
Copy Markdown
Author

CI was failing over a linting issue, I pushed a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant