Removed defaults for instance and description

This commit is contained in:
Scott Wallace 2020-10-25 08:41:19 +00:00
parent a8782e43d3
commit 0cb79d734a
2 changed files with 5 additions and 5 deletions

View file

@ -33,8 +33,6 @@ The following environment variables will override any config or default:
* Defaults, if not sent:
| Field | Default value |
|-------------|---------------|
| Description | `[nodata]` |
| Instance | `[unknown]` |
| Priority | `5` |
| Severity | `Warning` |

View file

@ -37,14 +37,16 @@ class MessageHandler:
else:
prefix = alert['labels'].get('severity', 'warning')
instance = alert['labels'].get('instance', None)
gotify_msg = {
'title': '[{}] {}'.format(
prefix.upper(),
alert['annotations'].get('summary'),
),
'message': '{}: {}'.format(
alert['labels'].get('instance', '[unknown]'),
alert['annotations'].get('description', '[nodata]'),
'message': '{}{}'.format(
f'{instance}: ' if instance else '',
alert['annotations'].get('description', ''),
),
'priority': int(alert['labels'].get('priority', 5)),
'extras': {