Prometheus but for logs. This egg is for Loki instance only! You usually need pushing agents like Promtail to put logs in this
Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus. It is designed to be very cost effective and easy to operate.
To get logs "into" Loki you need a scrape agent, such as official Promtail or a library for your app that can push logs through HTTP endpoint (gRPC endpoint is disabled in Docker enviroment by default)
As this egg sets up Loki in single node mode, it can consume a lot of disk space really fast. It is possible to setup different kind of storages for different parts of Loki files. For further information refer to official Loki documentation.
To get started, you can go with a minimum of 3GB RAM and >=2.5GB disk space.
Keep in mind that those numbers can grow pretty quick!
Ports required to run the server in a table format.
Port | default |
---|---|
Loki server | 3100 |
Name | Tag |
---|---|
ghcr.io/ptero-eggs/yolks:debian | ghcr.io/ptero-eggs/yolks:debian |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
Loki Version | The version of Loki to use. Find all versions from https://github.com/grafana/loki | LOKI_VERSION | latest | Yes | Yes |
#!/bin/bash
# Switch to mounted working install directory
cd /mnt/server
apt update
apt install -y zip unzip wget curl git file
ARCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")
# Download and extract Loki
if [ "$LOKI_VERSION" = "latest" ]; then LOKI_VERSION=$(curl --silent "https://api.github.com/repos/grafana/loki/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-); fi
echo -e "running curl -L https://github.com/grafana/loki/releases/download/v${LOKI_VERSION}/loki-linux-${ARCH}.zip --output loki-linux-amd64.zip"
curl -L https://github.com/grafana/loki/releases/download/v${LOKI_VERSION}/loki-linux-${ARCH}.zip --output loki-linux-${ARCH}.zip
unzip loki-linux-${ARCH}.zip
rm -rf loki-linux-${ARCH}.zip
curl -L https://raw.githubusercontent.com/grafana/loki/v${LOKI_VERSION}/cmd/loki/loki-docker-config.yaml --output loki-docker-config.yaml
mv loki-linux-* loki-linux
echo -e "installation completed"