If you would like to send logs directly to Grafana Loki without Promtail, use the following API to push logs: POST method http://example.com/loki/api/v1/push
- Docker
- Grafana
- Grafana Loki
- init - since Loki containers are running as
user 10001
and mounted data is owned by root, Loki would not have permissions to create the directories. Therefore theinit
container changes permissions of the mounted directory - loki - Grafana Loki container
- grafana - Grafana container
grafana-net
is important as it gives us ability to call containers by their names within the network instead of using IP addresses. For instance we are able to call Grafana Loki container as http://loki:3100
in Grafana container
3 volumes are used, 2 for Grafana Loki and 1 for Grafana
-
./loki-config.yaml:/etc/loki/local-config.yaml
this volume loads theloki-config.yaml
file from the host system and makes it available inside the loki container at the location/etc/loki/local-config.yaml
NOTE: do not change the path and file name! -
loki-data:/loki
is a bind mount, you will have to create/loki
directory beforehand. All the grafana loki data & logs will be stored here NOTE: it needs to be/loki
to work properly -
grafana-data:/var/lib/grafana
stores grafana data, like settings and dashboards