Removed defaults for instance and description
This commit is contained in:
parent
a8782e43d3
commit
0cb79d734a
|
@ -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` |
|
||||
|
||||
|
|
|
@ -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': {
|
||||
|
|
Loading…
Reference in a new issue