/fluentbit-loki-laboratory

๐Ÿ”ฌ Fluentbit + Loki + Grafana Laboratory ๐Ÿ”ฌ

๐Ÿ”ฌ Fluentbit + Loki Laboratory ๐Ÿ”ฌ

Setup a local laboratory ๐Ÿงช to explore Fluenbit and Loki

Usage

Start services:

docker-compose up -d

This starts the following services:

  • Grafana: local instance of Grafana exposed at http://localhost:3000
    • This instance is configured with a Loki datasource named "Loki"
  • Fluentbit: an instance of Fluentbit configured with the following config
  • Promtail: an instance of Promtail configured to scrape logs from Docker containers. Use label container to query for logs of each container.

Testing log ingestion

Fluentbit is configured to tail any *.log file written into test_logs on the host. Simply do:

echo '{"message": "lorem ipsum" "foo":"bar"}' >> test_logs/file.log

Or manually create/edit files under test_logs directory

Consulting ingested logs

Example Loki query

References