Giter Club home page Giter Club logo

docker-loki-distributed-minio's Introduction

docker-loki-distributed-minio

Distributed Loki setup with BoltDB and Minio using Docker

About

There's options for using different ring backend storage:

  • The docker-compose.yml provides a distributed loki stack with etcd as the backend kvstore
  • The docker-compose-consul.yml provides a distrubuted loki stack with consul as the backend kvstore
  • The docker-compose-traefik.yml provides a distrubuted loki stack with etcd as the backend kvstore

Components

This stack consists of:

  • loki-distributor (promtail or docker logging driver points to this component)
  • loki-querier (grafana or logcli points to this component)
  • loki-ingester
  • loki-table-manager
  • redis
  • etcd or consul

The architecture document can be viewed here

Pre-Requisites

For your containers to use to loki logging driver, you need to install it using:

$ docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions

Logging Options

To use loki logging driver (push logs directly to loki):

    logging:
      driver: loki
      options:
        loki-url: http://localhost:3101/loki/api/v1/push
        loki-external-labels: job=dockerlogs,environment=development

To use json file logging driver (and let promtail scrape the logs):

    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "1"
        tag: "{{.Name}}"

Boot the Stack:

I will boot the stack that includes consul as a backend:

docker-compose -f docker-compose-consul.yml up -d --build

Make HTTP Requests

Test the flask-app:

curl 'http://localhost:5000/?msg=hi'

Test the nginx-app:

curl 'http://localhost:8084/?msg=bye'

Example Queries

Query labels as k/v pairs using logfmt:

{container_name="flask-app"} | logfmt |= "scheme=http"

Metric Queries: Log Entries sum by container_name:

sum(rate({job="containerlogs"}[30s])) by (container_name)

Resources

Extra credit goes to the ones in the below issues, as I retrieved most of the loki config from there:

Documentation on Loki:

Extra resources to add a Go app to this stack:

Similar:

docker-loki-distributed-minio's People

Contributors

ruanbekker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.