Exporter only returns stats about pods from current running user?
mfenniak opened this issue · comments
Describe the bug
(I'm sorry to call this a "bug"; it's likely just a lack of my understanding over how to use this exporter successfully)
When I run prometheus-podman-exporter, it only exports container-level stats about the containers that are being run as the same user that I'm running the exporter as. Therefore, I don't know how to deploy prometheus-podman-exporter as a server-level monitoring tool -- it seems that I would need to run an instance of it for every user that could run pods?
To Reproduce
Steps to reproduce the behavior:
- Run prometheus-podman-exporter as a user account (ie. non-root user)
- Observe metrics like
podman_container_cpu_seconds_total
only reportsid=*
for containers running as the same user - Repeat, running as
root
-- even as a superuser, onlyroot
's containers are displayed
Expected behavior
I expected that running as root would return metrics from all pods. Alternatively, I expected the documentation in the repo to indicate the right way, or the expected runtime model, for prometheus-podman-exporter to be used effectively for monitoring at a server-level.
Screenshots
N/A; can provide if needed.
Desktop (please complete the following information):
NixOS 22.11
Additional context
I'm currently working on packaging prometheus-podman-exporter for NixOS. Building the software was straight-forward, but determining how to set up a systemd unit to run it has left me confused because of this. While it could run as a root user, which isn't typically how I'd want it to run anyway, it also wouldn't collect info on all the containers... leaving me a little confused on the recommended packaging approach.
A friendly reminder that this issue had no activity for 30 days.
Hi @mfenniak
At the moment you need to run a dedicated instance for each user.
Will add a feature in the near future in order to cover this request.