add support for custom annotations

master
jeltz 6 months ago
parent e1893769da
commit b5e9e1afb6
Signed by: jeltz
GPG Key ID: 800882B66C0C3326

@ -30,6 +30,10 @@ TEMPLATE_TEXT = (
"{{ labels.alertname }} {{ labels.instance }}"
"{% if annotations.summary %}"
"\n{{ annotations.summary }}"
"{% else %}"
"{% for key, value in annotations.items() %}"
"\n{{ key }} : {{ value }}"
"{% endfor %}"
"{% endif %}"
)
@ -46,6 +50,13 @@ TEMPLATE_HTML = (
"{% if annotations.summary %}"
"<br/>"
"<blockquote>{{ annotations.summary }}</blockquote>"
"{% else %}"
"<br/>"
"<ul>"
"{% for key, value in annotations.items() %}"
"<li><b>{{ key | capitalize }} :</b> {{ value }}</li>"
"{% endfor %}"
"</ul>"
"{% endif %}"
)

Loading…
Cancel
Save