Giter VIP home page Giter VIP logo

logs-with-loki's Introduction

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 as well as a sample Django REST Framework app on port 8000 (http://localhost:8000/api/log/).

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

logs-with-loki's People

Contributors

barseghyanartur avatar brpaz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.