Files
home_server/grafana
2024-02-03 11:58:42 +01:00
..
2024-02-03 11:58:42 +01:00
2024-02-03 11:58:42 +01:00
2024-02-03 11:58:42 +01:00
2024-02-03 11:58:42 +01:00
2024-02-03 11:58:42 +01:00

Grafana logging

in order to feed docker logs, which is kind of a big deal in this use case, we need to go through a few steps. By default, setting up grafana, loki and promtail, we will be able to see the /var/log/ files on the host machine.

Very nice & convienient, but we really want the docker logs as well.

Install the plugin

First installing the docker plugin for the loki driver.

docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions

After which you may need to restart the docker service.

sudo systemctl restart docker.service

Check if the plugin is installed.

docker plugin ls

We can then add the log pushing on a per container basis, by adding the follwing to each docker-compose.yml file.

logging:
    driver: loki
    options:
    loki-url: "http://localhost:3100/loki/api/v1/push"