Not receiving created alerts
Asked by Alain More:

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?


Answers:
author: Alain More
body: 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!

comments: author: Surawut Jirasaktavee
body: .


author: Surawut Jirasaktavee
body: Hi, [@Alain More](/t5/user/viewprofilepage/user-id/5112600) 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?

comments: author: Surawut Jirasaktavee
body: ![Screenshot 2566-01-05 at 18.05.39.png](https://community.atlassian.com/t5/image/serverpage/image-id/233144i70FAB47BA819CCBF/image-size/large?v=v2&px=999 "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?


author: Alain More
body: 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!


author: Surawut Jirasaktavee
body: Hi Alain,

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


author: Nick H
body: Hi [@Alain More](/t5/user/viewprofilepage/user-id/5112600) ,

If you are using the same body in these requests, it could be the alert is [deduplicating](https://support.atlassian.com/opsgenie/docs/what-is-alert-de-duplication/). 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](https://community.atlassian.com/t5/image/serverpage/image-id/233043iE2D1B487C165070D/image-size/large?v=v2&px=999 "dedup1.jpg")

Otherwise, you could also search the [Logs tab](https://support.atlassian.com/opsgenie/docs/search-logs/) for the request ID or timestamp to see what might be happening as well.

comments: author: Alain More
body: Thanks for your help, seems I was only missing a parameter in the request's body.


Tags: cloud