Code Monkey home page Code Monkey logo

grafana-matrix-forwarder's Introduction

Grafana to Matrix Forwarder

Forward alerts from Grafana to a Matrix chat room.

documentation pipeline status Go Report Card


This project provides a simple way to forward alerts generated by Grafana to a Matrix chat room.

Define a Grafana webhook alert channel that targets an instance of this application. This tool will convert the incoming webhook to a Matrix message and send it on to a specific chat room.

screenshot of matrix alert message

1. Features

  • 📦 Portable
    • As a single binary the tool is easy to run in any environment
  • 📎 Simple
    • No config files, all required parameters provided on startup
  • 🪁 Flexible
    • Support multiple grafana alert channels to multiple matrix rooms
  • 📈 Monitorable
    • Export metrics to track successful and failed forwards

2. How to use

This applies to unified alerts, check the documentation for legacy alerts

Step 1

Run the forwarder by providing a matrix account to send messages from.

$ ./grafana-matrix-forwarder --user @userId:matrix.org --password xxx --homeserver matrix.org

Step 2

Add a new Contact Point in Grafana with the POST webhook type. Use the following URL:

http://<ip address>:6000/api/v1/unified?roomId=<roomId>

Replace with the server ID and matrix room ID.

Step 3

Add a new Notification Policy in Grafana to send alerts to the new contact point.

If you use the root policy, all alerts will be sent to that contact point

Step 4

Create alert rules in grafana and add text to the a "Summary" field to be displayed in the Matrix message.

3. Docker

An official docker image is available on the Gitlab container registry. Use it by pulling the following image:

registry.gitlab.com/hectorjsmith/grafana-matrix-forwarder:latest

Example run command:

docker run -d \
    --name "grafana-matrix-forwarder" \
    -e GMF_MATRIX_USER=@user:matrix.org \
    -e GMF_MATRIX_PASSWORD=password \
    -e GMF_MATRIX_HOMESERVER=matrix.org \
    registry.gitlab.com/hectorjsmith/grafana-matrix-forwarder:latest

Read the documentation for more detail on using Docker.

Thanks

Made possible by the maunium.net/go/mautrix library and all the contributors to the matrix.org protocol.

grafana-matrix-forwarder's People

Contributors

hectorjsmith avatar

Stargazers

Sebastian avatar Lucas Pape avatar Tao Chen avatar Clément GIBAUD avatar Krafting avatar Alex Kelly avatar Cybervitexus avatar Deff avatar

Watchers

 avatar

grafana-matrix-forwarder's Issues

[Question] Markdown support?

Hi. Matrix support markdown messages. But I got a message with markdown syntax characters and without markup and line breaks.
Does line breaks and markdown supported?

grafana-matrix-forwarder doesn't exist

Step 1 says:

Run the forwarder by providing a matrix account to send messages from.

$ ./grafana-matrix-forwarder --user @userId:matrix.org --password xxx --homeserver matrix.org

but after git clone the repository I can't find any executable called grafana-matrix-forwarder.

After git clone what are the next steps before I can actually perform Step 1?

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.