Giter Site home page Giter Site logo

grafana-prometheus-loki-alertmanager-setup's Introduction

Grafana setup with

Link to my Blog post: https://andreas-mausch.de/blog/2021/05/14/monitoring-grafana/

Install Loki Docker Driver

docker plugin install grafana/loki-docker-driver:main-d9380ea --alias loki --grant-all-permissions

Run

docker-compose up

Grafana is accessible at http://localhost:3000
The first time login is admin/admin.

Start example logging service

docker run -it --rm --name my-service --log-driver=loki --log-opt loki-url="http://localhost:3100/loki/api/v1/push" --log-opt loki-pipeline-stages="- multiline:
           firstline: '^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},\\d{3}'
       " -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3 python my-service.py

After starting the service, you should see logs in grafana.

Stop the service, wait a few minutes, and you should see an alert email in mailhog.

Multiline

Check the Grafana docs on this topic to see allowed values.

Check alerts

Alerts are sent:

  • When the my-service is down for more than 1 minute
  • Any message is logged with the content error, failure or exception.

http://localhost:9093/#/alerts
http://localhost:8025

Clean up

docker-compose rm
docker volume rm grafana-prometheus-loki-alertmanager-setup_alertmanager grafana-prometheus-loki-alertmanager-setup_grafana grafana-prometheus-loki-alertmanager-setup_loki grafana-prometheus-loki-alertmanager-setup_prometheus

Source link in alert e-mails is broken for loki alerts

Right, I don't know how to solve it. I think the link displayed is the generatorURL sent to alertmanager.

And somebody requested to support the field in order to allow customized source links.

Maybe this will be fixed soon.

grafana-prometheus-loki-alertmanager-setup's People

Contributors

andreas-mausch 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.