SIOS AppKeeper automatically restarts failed Amazon EC2 services when notifications are received from Datadog, removing the need for expensive manual intervention. When Datadog triggers an alert, it restarts the EC2 service using the AppKeeper Recovery API.
Setup
Get the SIOS AppKeeper API key
Get the SIOS AppKeeper API key from AppKeeper GUI.
Click Account Information, and open the modal dialog.
Click Get Token.
Copy the token.
Install and configure the Webhooks integration
On the Datadog site, navigate to the Webhooks integration and install the integration.
Enter the id and name of name for the monitoring instance in the Payload section.
Register the AppKeeper API token in the Custom Headers section.
Integrate with Datadog monitoring
Create a new Datadog Synthetic test. Click New Test in the top right corner.
In the Define requests step, enter the URL you want to monitor.
In the Define assertions step, click New Assertion and add the following parameters: When status code is 200. This triggers an alert when the status code is not 200. If the request requires notification based on a different status, replace 200 with your status code.
Click New Assertion again and add a second set of parameters: And response time is less than 2000 ms. This triggers an alert when the response time is longer than 2000ms. If you require a longer or shorter duration, replace 2000 with your duration.
In the Notify your team step, add the webhook, formatted as @webhook-name_of_the_webhook. Include a message for the notification. Note: The minimum monitoring interval for the renotify if the monitor has not been resolved setting in this step is Every 10 Minutes. Setting to Never inhibits the webhook to call on AppKeeper’s recovery API.
Results of recoveries by AppKeeper are listed in AppKeeper’s GUI.