This commit is contained in:
msnie
2024-02-03 11:58:42 +01:00
parent 17ca1c805f
commit 5b0b5f548c
706 changed files with 135245 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
# 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.
```bash
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
```
After which you may need to restart the docker service.
```bash
sudo systemctl restart docker.service
```
Check if the plugin is installed.
```bash
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.
```yaml
logging:
driver: loki
options:
loki-url: "http://localhost:3100/loki/api/v1/push"
```