Skip to content

Loki

Prometheus but for logs. This egg is for Loki instance only! You usually need pushing agents like Promtail to put logs in this

egg-loki.json

updated

Ports

Add an allocation on the node for each port.

  • Loki server 3100

Install

Installer image
ghcr.io/pterodactyl/installers:debian
Install script
17 lines

Image

  • Debian ghcr.io/ptero-eggs/yolks:debian

Startup

The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.

1 variable

Startup command

./loki-linux -config.file=loki-docker-config.yaml
  • The version of Loki to use. Find all versions from https://github.com/grafana/loki

    LOKI_VERSIONUsers can edit

    required|string|max:20

Wings

Stop command
^C (SIGINT)
Running when the console shows
Loki started

Files Wings edits

Wings sets these values in these files before each start.

loki-docker-config.yaml yaml

server.http_listen_port
{{server.build.default.port}}
common.ring.instance_addr
0.0.0.0
common.path_prefix
/home/container/loki
common.storage.filesystem.chunks_directory
/home/container/loki/chunks
common.storage.filesystem.rules_directory
/home/container/loki/rules

Readme

Loki

From the Loki GitHub repository

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.

Working with Loki

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)

Resource consumption

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!

Server Ports

Ports required to run the server in a table format.

Port default
Loki server 3100

Changes

  1. add loki

    · Red Banana · 26c95ce

  2. Delete monitoring/loki/egg-loki.json

    · Red Banana · 3b26c05

  3. Added loki

    · Red Banana · d9b5da2

All changes on GitHub

Problem with this egg?

Open an issue on GitHub. Include your Panel and Wings versions.

Install script 17 lines bash in ghcr.io/pterodactyl/installers:debian Show
#!/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"