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:
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?
I just found the problem... I had to add this to the body of the request:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I put my API Key to the password and put the host with the URI API. Is this correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alain,
Do you put the host url as well? and what the operator you use in your python file?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
Otherwise, you could also search the Logs tab for the request ID or timestamp to see what might be happening as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your help, seems I was only missing a parameter in the request's body.
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.