Loki

Loki stores logs, and lets Grafana search them. Unlike most log systems, it doesn’t index the text of every log line, only a few labels such as job="fastapi", which makes it simple and cheap to run.

Loki doesn’t collect logs itself: Grafana Alloy, in the next section, reads the log files and sends them to Loki.

Create a volume for Loki’s data:

podman volume create loki-vol

And start Loki on the monitoring network. The image includes a configuration suitable for a single instance, storing everything on its local disk:

podman run -d --name loki --network monitoring-network -p 3100:3100 \
  -v loki-vol:/loki \
  docker.io/grafana/loki:3.7.11

Check it’s ready (it takes a few seconds to start):

curl http://localhost:3100/ready
ready