add title for resolved alerts

This commit is contained in:
psy 2021-01-06 13:20:05 +01:00
parent 96e6bc43d8
commit 338db46cbb
No known key found for this signature in database
GPG key ID: DFF5B17AC3A8ECF5

View file

@ -132,9 +132,9 @@ def postAlertmanager(chatName):
def send_alert_message(channel, alert):
message = "[**{state}**] [{instance}] {here}".format(state=alert['status'],
message = "[**{state}**] [{instance}] {amendment}".format(state=alert['status'],
instance=alert['labels'].get('instance', 'unknown'),
here='@here' if alert['status'] == 'firing' else '')
amendment='@here' if alert['status'] == 'firing' else alert['annotations'].get('title'))
attach = []
# attach details if alert is firing