Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,480
Community Members
 
Community Events
184
Community Groups

Alert notification template for alertmanager(prometheus) to send to opsgenie

Edited

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'

2 answers

1 vote
Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 18, 2020

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 H 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.

Nick H
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 24, 2020

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:

https://docs.opsgenie.com/docs/string-processing-methods

https://docs.opsgenie.com/docs/regular-expressions

Hi @Sumit Yadav

If you go in Atlassian | Start page you will find it here

hi @Ian Scrivens I have updated with sample template I created still facing the issue.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events