improve format of display_name and state_message

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-03-29 18:53:15 +02:00
parent c466659d8d
commit fb101d4152
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
2 changed files with 17 additions and 2 deletions

View File

@ -50,7 +50,20 @@ alertmanager_victorops_api_key: ~
alertmanager_victorops_service_url: ~
alertmanager_victorops_routing_key: ~
alertmanager_victorops_message_type: 'CRITICAL' # CRITICAL, WARNING, INFO
alertmanager_victorops_state_message: '{% raw %}Alert: {{ .CommonLabels.alertname }}. Summary:{{ .CommonAnnotations.summary }}. RawData: {{ .CommonLabels }}{% endraw %}'
alertmanager_victorops_monitoring_tool: 'metrics'
alertmanager_victorops_state_message: |
{% raw %}
{{ .CommonLabels.alertname }}:
{{ .CommonAnnotations.summary }}.
Common: {{ .CommonLabels }}
Group: {{ .GroupLabels }}
{% endraw %}
alertmanager_victorops_display_name: >-
{% raw %}
{{ .CommonLabels.datacenter }}.{{ .GroupLabels.fleet }}
({{ .GroupLabels.alertname }})
{% endraw %}
# For discovery of prometheus master nodes
consul_catalog_url: 'http://localhost:8500/v1/catalog'

View File

@ -35,5 +35,7 @@ receivers:
- name: 'victorops-alerts'
victorops_configs:
- routing_key: '{{ alertmanager_victorops_routing_key | mandatory }}'
state_message: '{{ alertmanager_victorops_state_message | mandatory }}'
message_type: '{{ alertmanager_victorops_message_type | mandatory }}'
monitoring_tool: '{{ alertmanager_victorops_monitoring_tool | mandatory }}'
entity_display_name: '{{ alertmanager_victorops_display_name | mandatory | trim }}'
state_message: '{{ alertmanager_victorops_state_message | mandatory | trim }}'