Skip to content

brpaz/logs-with-loki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logs with Loki

This repo contains the source code for my article Better docker logs with Loki, which demonstrates how to use Grafana Loki for better Docker Logs during development.

Pre-Requisites

Running the project

git clone https://github.com/brpaz/logs-with-loki
cd logs-with-loki
docker-compose up -d

This will start Grafana, Loki, Promtail and a Sample demo app using ealen/echo-server.

Gettings the logs

You can access your Grafana Dashboard, by going to localhost:3000 and login with admin/testloki.

The Loki datasource should already configured: (you can check it by navigating to: http://localhost:3000/datasources).

If you click on Loki datasource, and go down, press the "Test" button to ensure that Grafana can communicate with Loki.

Loki config

Then open "Explore" tab on the left, and you will see Loki interface.

If you click "Log labels", you should see some labels already populated from the Docker images.

Loki

The most useful one is the "container_name". Select one of the containers like logs-with-loki_grafana_1 and you should see the respective logs appear.

logs

Learn more

License

MIT

About

Example Loki project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published