Can any one share a sample template for alerts to be sent from alert manager to opsgenie.
Opsgenie template :
-----------------------
{{ define "ops_summary" }}
Environment: {{ .Alert.Labels.env}}
{{ end }}
I am unable to capture the value of this label and pass it as details tab to opsgenies extra properties. In alert at opsgenie it shows as {{ template "ops_summary" . }}
opsgenie_configs:
- send_resolved: true
details: { '{{ template "ops_summary" . }}' }
responders:
- name: 'test
type: 'team'
Hi @Sumit Yadav ,
A few samples/examples of Alertmanager << >> Opsgenie notification templates can be reviewed here in this other community post: https://community.atlassian.com/t5/Opsgenie-questions/How-to-set-Opsgenie-alert-priority-from-Prometheus-alert/qaq-p/1211053
Hope this helps! Let us know if you have any additional questions.
Hi @Nick Haller I used the logic mentioned however I would want to know how to capture single label/annotations value in template. This is a bit confusing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not an Alertmanager expert - nor have an instance myself to test - so I'm not entirely sure how to capture single label/annotations value in template. This is something you may want to reach out to Prometheus support for.
But - within the Opsgenie-Prometheus integration, you should be able to extract a single label/annotations value using either string processing or regex:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.