Setup a local laboratory ๐งช to explore Fluenbit and Loki
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.
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
- Access Grafana on http://localhost:3000/explore
- Query for logs whose label
job
isfluentbit
. E.g. LogQL query{job="fluentbit"}