Loki

Meet Grafana LOKI, a Log Aggregation System for Everything

By Techno TimPosted 4 months ago Updated 12 days ago 4 min read

I’ve been on a quest to find a new logging system. I’ve use quite a few in the past, some open source, some proprietary, and some home grown, but recently I’ve decided to switch. I’ve switched to Grafana Loki for all of my logs for all of my systems - this includes machines, devices, docker systems and hosts, and my all of my kubernetes clusters. If you’re thinking of using Grafana and are also looking for a fast way to log all of your systems, join me as we discuss and configure Grafana Loki

Don’t want to host it yourself? Check out Grafana Cloud and sign up for a free account https://l.technotim.live/grafana-labs

See all the hardware I recommend at https://l.technotim.live/gear

Don’t forget to check out the 🚀Launchpad repo with all of the quick start source files.

Docker Setup

See this post on how to install docker and docker-compose

Running the container

If you’re using Docker compose

docker-compose.yml

Loki Config

loki-config.yml

Promtail Config

promtail-config.yml

Loki Docker Driver

Install docker plugin

Edit docker daemon config

daemon.json

Restart docker daemon.

You will also need to recreate your containers after applying this setting *

LogQL sample queries

Query all logs from the varlogs stream

Query all logs from the varlogs stream and filter on docker

Query all logs from the container_name label of uptime-kuma and filter on host of juno

Read more about LogQL here

ARM CPU (Raspberry Pi)

There is a workaround for using this with ARM CPUs. Credit to AndreiTelteu for finding this in this discussion

delete /etc/docker/daemon.json

Add the vector service to the docker-compose.yml file

Run this command

paste this config in the file:

Credits to this post for the config file: grafana/loki#2361 (comment)

Kubernetes Setup

If you’re looking to set this up in kubernetes, see this post

Last updated