Integrate Loki with Podman

The documentation explains that for using Loki with Docker, one can install a plugin which grabs the filesystem equivalents of docker logs and forwards them to Loki.

So far, so good.

However, currently i am evaluating Podman as a standalone solution replacing Docker. I am aware that the main focus of all this OCI stuff is to let containers run on k8s with CRI-O, but for my use case a whole k8s environment would be oversized. However, Podman is not equipped with a plugin API, so although it is for 90% a docker replacement, i am currently unsure how to integrate Loki with Podman.

Are there any best practices?


Out of curiosity, @simonszu - what did you end up doing here?

We’re facing the same problem now with RHEL8+ pushing podman over docker.

Logging on Nomad and log aggregation with Loki :: Adrian Todorov has some interesting approaches, though they don’t contend with podman, and curiously they don’t use the Loki plugin for Docker either.

Maybe a matter of requesting a loki-podman-driver here Issues · grafana/loki · GitHub
Also look here to maybe start implementing your own solution to tail logs from a podman container

Thanks @yosiasz – we’re actually enterprise customers, so I had raised a query through support directly about this feature request. I note you’ve created grafana/loki-podman-driver · Issue #6279 · grafana/loki · GitHub - thanks for that.

And yes, tracking through podman-logs is one of the slightly-less-elegant ways of achieving the goal - it’s not quite as seamless when compared to the Loki plugin for Docker approach we’re using now.

1 Like

podman itself has to implement some sort of logger like docketr does?

That’s one avenue, certainly. I’ll note that podman is developed primarily by RedHat, and they would encourage their customers to use their OpenShift product.

Like OP, we’re using a different approach (Hashicorp Nomad in our case) than the more common k8s / OpenShift.