Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade OpsGenie notifier to v2 API #1061

Merged

Conversation

Tom-Fawcett
Copy link
Contributor

Closes #902

The OpsGenie Web API (referred to as 'old' below) is deprecated.

This upgrades Alertmanager to the OpsGenie REST Alert API (referred to as 'new' below).


Key changes made

  • Use new paths.
  • Use new auth header.
  • Adjust response code logic.
    • Docs
    • Expand retry to include new "429 - Too Many Requests" throttling.
    • We no longer need to handle closing an already closed alert, as such a request is now asynchronous.

Transition

  • No changes in config.
  • New integration still uses alert alias, so it is backwards compatible.
    • i.e. you can open a request on the old API and close it on the new API.

Tests

  • Open an alert with Alertmanager, then close with Alertmanager. ✓
  • Open an alert with Alertmanager, close elsewhere, then observe Alertmanager attempting to close without erroring. ✓

Asynchronous

Unlike the old API, the new API is asynchronous.

Alert creation, deletion and action requests are processed asynchronously to provide higher availability and scalability, therefore valid requests for those endpoints are responded with HTTP status 202 - Accepted.

link

  • It seems reasonable to keep things simple, and not attempt to write a load of logic around requesting the status of previous requests.
  • This works to our advantage when attempting to close an already closed alert, as we are returned 202.

@stuartnelson3 stuartnelson3 self-requested a review October 29, 2017 15:16
Copy link
Contributor

@stuartnelson3 stuartnelson3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@stuartnelson3 stuartnelson3 merged commit 2d1b84f into prometheus:master Oct 29, 2017
@Tom-Fawcett
Copy link
Contributor Author

Great 😄

This was referenced Nov 13, 2017
bjakubski added a commit to bjakubski/docs that referenced this pull request Feb 25, 2019
since prometheus/alertmanager#1061 new API is
used.

Signed-off-by: Bartosz Jakubski <b.jakubski@gmail.com>
brian-brazil pushed a commit to prometheus/docs that referenced this pull request Feb 25, 2019
since prometheus/alertmanager#1061 new API is
used.

Signed-off-by: Bartosz Jakubski <b.jakubski@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpsGenie v1 API seems to be deprecated
2 participants