Skip to content
Snippets Groups Projects
Commit 0f5e4c9d authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

L2SS-1017: add documentation

parent c24b28f4
No related branches found
No related tags found
1 merge request!466L2SS-1017: test logging with Promtail
...@@ -22,4 +22,3 @@ MYSQL_ROOT_PASSWORD=secret ...@@ -22,4 +22,3 @@ MYSQL_ROOT_PASSWORD=secret
MYSQL_PASSWORD=tango MYSQL_PASSWORD=tango
TEST_MODULE=default TEST_MODULE=default
DOCKER_LIB_PATH=/mnt/wsl/docker-desktop-data/version-pack-data/community/docker
...@@ -3,9 +3,15 @@ input { ...@@ -3,9 +3,15 @@ input {
port => 5044 port => 5044
# TODO (L2SS-748) add SSL encryption # TODO (L2SS-748) add SSL encryption
} }
}
input {
syslog { syslog {
port => 1514 port => 1514
} }
}
input {
tcp { tcp {
port => 5959 port => 5959
codec => json codec => json
......
...@@ -37,7 +37,8 @@ services: ...@@ -37,7 +37,8 @@ services:
volumes: volumes:
- /var/log:/var/log - /var/log:/var/log
- lofar_log:/var/lofarlog - lofar_log:/var/lofarlog
- ${DOCKER_LIB_PATH}:/var/lib/docker # Setting up the Docker Driver Client for Grafana requires a mapping with the O.S. Docker Data Path
# f.e. in Windows-WSL -> /mnt/wsl/docker-desktop-data/version-pack-data/community/docker:/var/lib/docker
command: -config.file=/etc/promtail/config.yml command: -config.file=/etc/promtail/config.yml
networks: networks:
- control - control
......
# Promtail
Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance.
## Usage and configuration
Promtail can only be configured to scrape logs from a file, pod, or journal.
Since we do not save our TANGO device logs to file, it currently appears inconvenient using it for our lofar devices logs.
It can rather be used for systemlogs, server logs saved to disk, and docker container logs (but, in this case, GrafanaLabs have developed a tailored Docker plugin that allows to send logs directly to Loki - [https://grafana.com/docs/loki/latest/clients/docker-driver/])
Since our devices use a python log handler, this last one can be configured to send logs directly to Loki without passing through Promtail [https://medium.com/geekculture/pushing-logs-to-loki-without-using-promtail-fc31dfdde3c6]
## Using Docker Driver Client
To get the Docker Driver working, the steps are:
* Install the Docker Driver Plugin
`docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions`
see [https://grafana.com/docs/loki/latest/clients/docker-driver/]
* Change the default Logging Docker Driver, i.e. update the Docker daemon.json file
see [https://grafana.com/docs/loki/latest/clients/docker-driver/configuration/)]
* Restart the Docker daemon and rebuild all the containers
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment