Customize alert for Webhook

Hi there,

I want to push notifications on a “non supported” API (Stackfield).
My understanding is that I have to push on a webhook, somehow do the templating then push the stackfield API the formatted message.

Am I right or did I missed something ?

If I am right, I wonder how I could get the valueString in a format that could be exploit easily (JSON for instance) instead of a go formatted toString :pray: ?

Thanks in advance

Hi! I’m afraid templating of webhook notifications is not supported in Grafana. You will need to put some kind of rewriting proxy in between Grafana and the non-supported API.

1 Like

Node-RED can take the webhook from Grafana and do whatever you want with it (except make breakfast).

Great! However, do you know if there is a way of getting the the valueString that contains the alert details in more convenient format ?

"valueString": "[ var='B0' metric='replication' labels={deployment=prod-us} value=0.016666666666666666 ], [ var='B1' metric='replication' labels={deployment=prod-eu} value=0.13333333333333333 ], ...

I do not see why not, although all I can do at the moment is send out a test alert (no valueString info to inspect). After installing Node-RED on the same machine as Grafana, the webhook data looks like this:


Anything above can be manipulated through change nodes to make it appear however you wish. Then that content / message would be sent out to Stackfield via webhook.

I will post actual content with the valueString details once I get an actual alarm (should happen sometime today).