Idiots guide to templating alerts for email or Teams? To be more readable

Hello,

I’ve almost given up trying to understand how to get alerts readable in Grafana v9 (v8 was ok).

Could someone guide me through getting one alert readable then I think the rest will click in my head. It’s not something that is coming naturally to me.

Here is an example of an email alert I get, I’ve removed everything in it, but Grafana is looking for a Citrix Windows service running and if it stopped then email.

Here is what the email sends:

Value: [ var='L0' metric='Server: CitrixDC5 Service: CitrixBrokerService' labels={host=CitirxDC5, service_name=CitrixBrokerService} value=1 ]

I want the email or Teams alert to look like:

Server=CitrixDC5
service_name=CitrixBrokerService
value=1

How do I do this please? I really need to go back to basics .

Thanks

I found this guide very helpful:

https://localhost:3000/t/how-to-use-alert-message-templates-in-grafana/67537/7

I believe we are working on more resources to simplify the templating

1 Like

Amazing if you are it will be very welcome among the community, especially in the Reddit Grafana community.

Any update since October?

Hi! I would recommend changing your alert rule from using a Classic Condition to using a Reduce and Math expression. This will 1. allow you to have separate alerts per server 2. make templating of those alerts easier.

Then I would suggest reading through our new documentation on templating notifications Customize notifications | Grafana documentation.

If you still have questions then I would be happy to answer them :slight_smile: