Introduction
DataSet Alerts can create StatusPage incidents with the StatusPage REST API. This approach is more versatile than the StatusPage email integration, as webhooks don't depend on a mail server for incident delivery. Furthermore, the StatusPage REST API allows access to parameters that are not available via the email automation method.
Alerts have can issue POST or GET requests via webhook, however, the server response isn't processed (beyond its response code).
Due to the way StatusPage incidents are created, we recommend disabling alert reminders (or a new incident will be created every X renotifyPeriodMinutes
.
Configuration
We are using a very basic example of the StatusPage incidents API call. The DataSet alert is configured as follows:
...
{
alertAddress: "webhook-trigger:POST https://api.statuspage.io/v1/pages/PAGE_ID/incidents?api_key=XXX[[{\"incident\":{\"name\":\"Whoops just occurred\",\"status\":\"investigating\",\"deliver_notifications\":true,\"body\":\"This is a test\"}}]]&content-type=application/json",
description: "Incident alert!",
gracePeriodMinutes: 0,
renotifyPeriodMinutes: 0,
resolutionDelayMinutes: 5,
trigger: " ... Enter your trigger ..."
}
...
Notes
- As detailed within the StatusPage API documentation, POST requests are used to create an element in a collection.
- The
PAGE_ID
andapi_key
values are obtained by clicking the user menu and choosing the "API info" option. You may need to create an API key if you have not already done so. - It should be noted that the
&content-type=application/json
URL parameter is essential. Note: This appears to be specific to the StatusPage platform. Without it, StatusPage will expect a different value format. - Nested JSON fields are supported.
- We recommend referring to this article when testing your configuration, as it includes some helpful diagnostic information.
Once the DataSet alert has been triggered, a corresponding incident is created on StatusPage:
Comments
0 comments
Please sign in to leave a comment.