make instance label optional
This commit is contained in:
parent
527ab60069
commit
c1e1501649
1 changed files with 6 additions and 5 deletions
9
bot.py
9
bot.py
|
@ -27,8 +27,9 @@ TEMPLATE_TEXT = (
|
|||
"{% elif labels.severity == 'warning' %}"
|
||||
"ATTENTION "
|
||||
"{% endif %}"
|
||||
"{{ labels.alertname }} {{ labels.instance }}"
|
||||
"{% if annotations.summary %}"
|
||||
"{{ labels.alertname }}"
|
||||
"{% if labels.instance is defined %} {{ labels.instance }}{% endif %}"
|
||||
"{% if annotations.summary is defined %}"
|
||||
"\n{{ annotations.summary }}"
|
||||
"{% else %}"
|
||||
"{% for key, value in annotations.items() %}"
|
||||
|
@ -46,8 +47,8 @@ TEMPLATE_HTML = (
|
|||
"<b><font color='orange'>ATTENTION</font></b> "
|
||||
"{% endif %}"
|
||||
"<b>{{ labels.alertname }}</b>"
|
||||
"{{ labels.instance }}"
|
||||
"{% if annotations.summary %}"
|
||||
"{% if labels.instance is defined %} {{ labels.instance }}{% endif %}"
|
||||
"{% if annotations.summary is defined %}"
|
||||
"<br/>"
|
||||
"<blockquote>{{ annotations.summary }}</blockquote>"
|
||||
"{% else %}"
|
||||
|
|
Loading…
Reference in a new issue