gyptazy

DevOps

Developer

IT Consultant

gyptazy

DevOps

Developer

IT Consultant

Blog Post

HowTo: Integrate Matrix Alerts into Grafana with Webhooks

2024-05-07 Grafana, HowTos, Monitoring
HowTo: Integrate Matrix Alerts into Grafana with Webhooks

Unfortunately, Grafana does not support Matrix notification by default. While Matrix is originally a free and open-source chat service, it also provides API and Bot support which makes it handy for service notifications. With End-to-end encryption, open-source, self-hosting possibilities and multi client support it provides all necessary features to integrate this as a fast and reliable notification solution to receive any kind of monitoring alerts.

With the grafana-matrix-forwarder by Hector S., a Grafana integration for Matrix alert notifications can be easily done within just a few minutes. In this case, the grafana-matrix-forwarder (written in Go) just runs as a dedicated binary and accepts requests by http on port tcp/6000. The integration will follow as a webhook in Grafana.

The installation and configuration of this forwarder is pretty easy and straight forward. The binary will just be copied and executed by a dedicated user.

    Alert -> Contact points -> Add contact point

The new contact point will be created with the following options:

    name: matrix-channel-notification
    Integration: Webhook
    URL: http://localhost:6000/api/v1/unified?roomId=!CHANNELCHANNEL:gyptazy.com

Note: Make sure to replace your server (if not running on the Grafana instance) and roomID.

Afterwards, the integration is done and the Matrix notifications can be used in general. Further customizing, linking to alerts etc. may be needed.

Resources

Taggs: