Files
oam/knowledge base/promtail.md
2025-01-06 17:37:39 +01:00

1.4 KiB

Promtail

TODO

Agent shipping the contents of local logs (e.g. files, systemd's journal, k8s pods) to some Grafana Loki instance.

  1. TL;DR
  2. Further readings
    1. Sources

TL;DR

Comes packaged with Loki releases.

Setup
# Install via package repository.
apt install 'promtail'
dnf install 'promtail'

# Run via Docker.
docker run --name 'promtail' -d \
  -p '9080:9080' -v "$(pwd)/config/promtail.yml:/etc/promtail/config.yml:ro" \
  'grafana/promtail:3.3.2' -config.file='/etc/promtail/config.yml'

Default configuration file for package-based installations is /etc/promtail/config.yml.

Usage
# Do a test run
promtail -dry-run -config.file '/etc/promtail/config.yml'

# Check the server is working
curl 'http://promtail.fqdn:9080/ready'
curl 'http://promtail.fqdn:9080/metrics'

# Connect to the web server
open 'http://promtail.fqdn:9080/'

Further readings

Sources