I am currently setting up grafana alerts. How do I customize my message template so my alert email shows The ip address of the server, the state of the server and the node/instance?
Thank you.
I am currently setting up grafana alerts. How do I customize my message template so my alert email shows The ip address of the server, the state of the server and the node/instance?
Thank you.
Copyright © 2021 Jogjafile Inc.
I figured it out once, then recently I updated my grafana instance that wiped my work and I had to figure it out again. It was tough the first time.
You can use the labels that are made available through prometheus in your summary and description sections in your alerts by using the syntax:
{{$labels.instance}}
{{$labels.value}}
https://prometheus.io/docs/prometheus/latest/configuration/template_examples/
The only catch is that you have to use Math expression in the last condition in your alert rule for the labels to be available in the Summary section of the alert.
For example, in our personal alerts we will use something like: