Difference between revisions of "Grafana Loki"

From NixNet
m (Amolith moved page Loki to Grafana Loki)
(No difference)

Latest revision as of 21:06, 16 September 2021

This article is part of a series of guides that describe NixNet's setup in excruciating detail. If you would like to follow them, please start at the Infrastructure page.
Caution: this guide is not finished yet; following it may leave you with an unuseable machine. To be notified of updates, please create an account and add it to your watchlist.


We can follow the latest binary install instructions from their github releases. Download the Loki and Promtail binaries.

curl -O -L "https://github.com/grafana/loki/releases/download/v2.2.0/loki-linux-amd64.zip"
curl -O -L "https://github.com/grafana/loki/releases/download/v2.2.0/promtail-linux-amd64.zip"
unzip "loki-linux-amd64.zip"
unzip "promtail-linux-amd64.zip"
# make sure it is executable
chmod a+x "loki-linux-amd64"
chmod a+x "promtail-linux-amd64"


Grab the sample configurations for Loki and Promtail:

wget https://raw.githubusercontent.com/grafana/loki/master/cmd/loki/loki-local-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/master/clients/cmd/promtail/promtail-local-config.yaml

The default Loki config should be good, Loki will just have to be started and pointed to the config. This can be done with a systemd service:

Description=Loki, a log aggregation tool
After=network.target network-online.target

ExecStart=/home/loki/loki-linux-amd64 --config.file=/home/loki/loki-local-config.yaml