Grafana-threema-forwarder - Alert forwarder from Grafana webhooks to Threema wire messages

Grafana to Threema alert forwarder

Although Grafana has built in support for pushing alerts to Threema, it is done through the Treema Gateway, which costs about $0.15 for every alert (message + image + thumbnail x $0.05). Furthermore, the Threema Gateway costs $64 to gain access. This might be acceptable for low-traffic production system, but for personal use, it's wonky.

This project implements a Threema notification channel for Grafana using the go-threema library. This approach relies on a personal Threema account, which - although still licensed - is a small, one time expense.

Unfortunately, Grafana does not accept new notification channels implementations into their codebase. The reasoning is that they would like to ship plugin support for alerts, which has been in the backlog since 2019. As such, this project is forced to implement a webhook server that Grafana can ping on alerts.

Running the forwarder

The recommended way to run the Grafana to Threema forwarder is via docker. You can of course run it directly (it's a single-file Go code), but our assumption is that you're using some container infrastructure when monitoring things.

Building the forwarder is straightforward via docker:

$ docker build --tag grafana-threema-forwarder .

Running the forwarder requires a few credentials. These can be provided either via CLI flags, or - better suited to the container world - environment variables:

  • --id or G2T_ID_BACKUP is the exported Threema identity.
  • --id.secret or G2T_ID_SECRET is the encryption password for the identity.
  • --to or G2T_RCPT_ID is a comma separated list of Threema IDs to send notifications to.
  • --to.pubkeys or G2T_RCPT_PUBKEY is a comma separated list of pubkeys of the recipients.

The forwarder listens on port 8000. To configure your Grafana to send alerts to it, create a new WebHook alert channel and set it to http://address:8000, with images enabled.

Grafana quirks

In order to generate images, Grafana needs the image rendering plugin installed. If you are running dockerized Grafana, that image will not support it. In that case you can deploy the renderer as a separate docker container. See the render docs for details on how to do it.

Even with images generating, Grafana cannot embed those into webhook notifications. The solution is to configure an image provider where Grafana can upload the alert charts. In our case, hosting them locally is perfectly fine as the forwarder will retrieve them locally and send it through the Threema protocol. To do that, set the GF_EXTERNAL_IMAGE_STORAGE_PROVIDER environment variable on Grafana to local.

Contributing

If something doesn't work, please open an issue. That said, I kind of consider this project done. There's only so many features a dumb notification forwarder can have.

License

3-Clause BSD

Owner
Péter Szilágyi
Author of @project-iris, creator of @regionrank, co-creator of @etherapis, team lead at @ethereum relaxing at the piano and on the cliffs.
Péter Szilágyi
Similar Resources

Grafana Dashboard Manager

Grafana dash-n-grab Grafana Dash-n-Grab (GDG) -- Dashboard/DataSource Manager. The purpose of this project is to provide an easy to use CLI to interac

Dec 31, 2022

Download your Fitbit weight history and connect to InfluxDB and Grafana

WemonFit Weight monitoring for Fitbit, using InfluxDB and Grafana Generating a new certificate openssl req -new -newkey rsa:2048 -nodes -keyout lo

Oct 22, 2022

PoC for Grafana 8.x Local File Inclusion (Pre-Auth)

Grafana 8.x Local File Inclusion (Pre-Auth) CVE: Pending All credits go to j0v and his tweet https://twitter.com/j0v0x0/status/1466845212626542607 Dis

Nov 9, 2022

Grafana Unauthorized arbitrary file reading vulnerability

Grafana Unauthorized arbitrary file reading vulnerability

CVE-2021-43798 Grafana Unauthorized arbitrary file reading vulnerability 8.3.1 (2021-12-07) Security: Fixes CVE-2021-43798 . For more information, see

Dec 25, 2022

Grafana DB2 Data Source Backend Plugin

Grafana DB2 Data Source Backend Plugin This template is a starting point for building Grafana Data Source Backend Plugins What is Grafana Data Source

Dec 13, 2021

Otus prometheus grafana for golang

HW Prometheus. Grafana Clone the repo: git clone https://github.com/alikhanmurzayev/otus_kuber_part_3.git && cd otus_kuber_part_3 Prepare workspace: m

Dec 17, 2021

Cole - Cole can use his sixth sense to give you metrics about your Grafana dashboards

Cole Cole can use his sixth sense to give you metrics about your Grafana dashboa

Nov 9, 2022

Grafana Data Source Backend Plugin Template

Grafana Data Source Backend Plugin Template This template is a starting point for building Grafana Data Source Backend Plugins What is Grafana Data So

Jan 16, 2022

Grafana Data Source Backend Plugin

Grafana Data Source Backend Plugin

Grafana Data Source Backend Plugin This plugin allows you to receive telemetry i

Sep 18, 2022
grafana-sync Keep your grafana dashboards in sync.

grafana-sync Keep your grafana dashboards in sync. Table of Contents grafana-sync Table of Contents Installing Getting Started Pull Save all dashboard

Dec 14, 2022
Snowflake grafana datasource plugin allows Snowflake data to be visually represented in Grafana dashboards.
Snowflake grafana datasource plugin allows Snowflake data to be visually represented in Grafana dashboards.

Snowflake Grafana Data Source With the Snowflake plugin, you can visualize your Snowflake data in Grafana and build awesome chart. Get started with th

Dec 29, 2022
A Grafana backend plugin for automatic synchronization of dashboard between multiple Grafana instances.

Grafana Dashboard Synchronization Backend Plugin A Grafana backend plugin for automatic synchronization of dashboard between multiple Grafana instance

Dec 23, 2022
Terraform-grafana-dashboard - Grafana dashboard Terraform module

terraform-grafana-dashboard terraform-grafana-dashboard for project Requirements

May 2, 2022
An Alert notification service is an application which can receive alerts from certain alerting systems like System_X and System_Y and send these alerts to developers in the form of SMS and emails.

Alert-System An Alert notification service is an application which can receive alerts from certain alerting systems like System_X and System_Y and sen

Dec 10, 2021
HSDP Metrics alerts webhook broker and CF events forwarder for Microsoft Teams

hsdp-events Microservice helper to translate HSDP Metrics webhooks to Microsoft Teams webhooks Configuration Environment Description EVENTS_TOKEN Rand

Mar 18, 2022
The k8s-generic-webhook is a library to simplify the implementation of webhooks for arbitrary customer resources (CR) in the operator-sdk or controller-runtime.

k8s-generic-webhook The k8s-generic-webhook is a library to simplify the implementation of webhooks for arbitrary customer resources (CR) in the opera

Nov 24, 2022
Go framework to create Kubernetes mutating and validating webhooks
Go framework to create Kubernetes mutating and validating webhooks

kubewebhook Kubewebhook is a small Go framework to create external admission webhooks for Kubernetes. With Kubewebhook you can make validating and mut

Jan 4, 2023
Admission webhooks the easy way

admission-webhooks-the-easy-way Goals controller-runtime simple and simpler type

Mar 13, 2022
Grafana Tempo is a high volume, minimal dependency distributed tracing backend.
Grafana Tempo is a high volume, minimal dependency distributed tracing backend.

Grafana Tempo is an open source, easy-to-use and high-scale distributed tracing backend. Tempo is cost-efficient, requiring only object storage to ope

Jan 8, 2023