Hi everyone,
I am trying to get alertmanager to forward alerts to opsgenie.
I have had a look at https://prometheus.io/docs/alerting/latest/configuration/#opsgenie-receiver-%3Copsgenie_config%3E - but reading that page didn't help much.
I found the following thread on this forum: https://community.atlassian.com/t5/Opsgenie-questions/Alert-notification-template-for-alertmanager-prometheus-to-send/qaq-p/1560666
but then again when I run that code, I get the following error in the alertmanager container:
err="yaml: unmarshal errors:\n line 10: field priority not found in type config.plain"
Below is my alertmanager.yml file:
global:
resolve_timeout: 1m
opsgenie_api_url: 'XXXXXXX'
opsgenie_api_key: 'XXXXXXX'
receivers:
- opsgenie_configs:
- responders:
- type: team
name: "TwigOps"
priority: '{{ range .Alerts }}{{ if eq .Labels.severity "critical"}}P1{{else if eq .Labels.severity "warning"}}P2{{else if eq .Labels.severity "info"}}P3{{else}}P4{{end}}{{end}}'
name: opsgenie
route:
group_by: ['alertname','service']
receiver: opsgenie
repeat_interval: 5m
Is there a template file I could download? It seems to me that the above code might be missing some declarations which is why "priority" is not found as a field.
Thanks for your help