Not receiving created alerts

Alain More January 3, 2023

Hi,

I'm working on implementing opsgenie for the first time, with a new airflow instance. I have been unable to receive alerts so far, even though everything seems to be correctly set up.

I already have my account/team and integrations (slack and api) set. I already configured the opsgenie conection in airflow (using the slack api key as password). An I already added the opsgenie hook to my code.

It all seems to work ok. According to the airflow logs, the opsgenie genie request is correctly sent. I even get responses like this:

Sending 'POST' to url: https://api.opsgenie.com/v2/alerts
<Response [202]>
{'result': 'Request will be processed', 'took': 0.007, 'requestId': '65f2a665-40ea-4173-967e-xxxxxxxxxx'}

If I search for the request id, I get this response:

 

{
"data": {
"success": true,
"action": "Create",
"processedAt": "2023-01-03T16:40:03.08Z",
"integrationId": "xxx",
"isSuccess": true,
"status": "Created alert",
"alertId": "xxx",
"alias": "ECO_OPSGENIE_ALERTS-send_opsgenie_alerts-20230103"
},
"took": 0.004,
"requestId": "65f2a665-40ea-4173-967e-xxxxxxxxxx"
}

However, NO alerts are ever sent, and I can't see them anywhere in the opsgenie alerts section. And of course I also get bothing on slack or on the opsgenie app.

If I create a "manual" alert using the opsgenie app, I do get slack and app alerts... but nothing using the API.

I also tried directly from postman, but same thing: no alerts are sent, even though the response says they were correctly created.

Any idea what could be causing this and how to solve it?

3 answers

1 accepted

2 votes
Answer accepted
Alain More January 5, 2023

I just found the problem... I had to add this to the body of the request:

"responders": [
{
"name": team_name,
"type": "team"
}
]
I had the team_name set in the user field.
Now it's all working!
Surawut Jirasaktavee January 5, 2023

.

0 votes
Surawut Jirasaktavee January 5, 2023

Hi, @Alain More  I am trying to set up the Airflow connection with Opsgenie as well and trying to test the connection but it cannot connect. can you share with me how you set the connection?

Surawut Jirasaktavee January 5, 2023

Screenshot 2566-01-05 at 18.05.39.png

 

I put my API Key to the password and put the host with the URI API. Is this correct?

Alain More January 5, 2023

Hi Surawut,

 

Yeah that part is pretty straightforward. Only write a connection_id, set the connection type to HTML and set the API key of your integration into the password field. That's it!

Like Surawut Jirasaktavee likes this
Surawut Jirasaktavee January 5, 2023

Hi Alain, 

 

Do you put the host url as well? and what the operator you use in your python file?

0 votes
Nick Haller
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 4, 2023

Hi @Alain More ,

If you are using the same body in these requests, it could be the alert is deduplicating. This occurs when the alias of an alert matches the alias of an open existing Opsgenie alert.

You can search your Alerts tab for a query like below to see if there is an open alert with multiple deduplications:

alias: "ECO_OPSGENIE_ALERTS-send_opsgenie_alerts-20230103"

dedup1.jpg

 

Otherwise, you could also search the Logs tab for the request ID or timestamp to see what might be happening as well.

Alain More January 5, 2023

Thanks for your help, seems I was only missing a parameter in the request's body.

Suggest an answer

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

Atlassian Community Events