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:
|
* Defaults, if not sent:
|
||||||
| Field | Default value |
|
| Field | Default value |
|
||||||
|-------------|---------------|
|
|-------------|---------------|
|
||||||
| Description | `[nodata]` |
|
|
||||||
| Instance | `[unknown]` |
|
|
||||||
| Priority | `5` |
|
| Priority | `5` |
|
||||||
| Severity | `Warning` |
|
| Severity | `Warning` |
|
||||||
|
|
||||||
|
|
|
@ -37,14 +37,16 @@ class MessageHandler:
|
||||||
else:
|
else:
|
||||||
prefix = alert['labels'].get('severity', 'warning')
|
prefix = alert['labels'].get('severity', 'warning')
|
||||||
|
|
||||||
|
instance = alert['labels'].get('instance', None)
|
||||||
|
|
||||||
gotify_msg = {
|
gotify_msg = {
|
||||||
'title': '[{}] {}'.format(
|
'title': '[{}] {}'.format(
|
||||||
prefix.upper(),
|
prefix.upper(),
|
||||||
alert['annotations'].get('summary'),
|
alert['annotations'].get('summary'),
|
||||||
),
|
),
|
||||||
'message': '{}: {}'.format(
|
'message': '{}{}'.format(
|
||||||
alert['labels'].get('instance', '[unknown]'),
|
f'{instance}: ' if instance else '',
|
||||||
alert['annotations'].get('description', '[nodata]'),
|
alert['annotations'].get('description', ''),
|
||||||
),
|
),
|
||||||
'priority': int(alert['labels'].get('priority', 5)),
|
'priority': int(alert['labels'].get('priority', 5)),
|
||||||
'extras': {
|
'extras': {
|
||||||
|
|
Loading…
Reference in a new issue