An alert is a notification that lets you know that some particular event has occurred with one of the APIs that you are monitoring when the API was called. This might be that the call failed or the response was very slow.
You can use Conditions to set your own criteria for whether a response is flagged as a warning or an error. For instance, you might want to receive an alert if a required field in the the returned payload is empty.
You can also alert on a Pass, which is especially useful for negative testing in which yiu want to be alerted if a call passes.
We provide support for the following alert types:
- Pass - an API call has met the pass conditions (by default a HTTP 200)
- Warning - an API call has triggered a warning (by default a 4XX client-side result)
- Error - an API call has triggered an error (by default a 5XX server-side result)
- SLA error or warning - the call or part of a workflow has exceeded its expected duration or some other specified Service Level Objective
- Slow - the call is outside of an expected parameter
Alerts can be set on an API by API basis or globally for all your APIs.
To set an alert for a particular API, click on the Alerts & Webhooks tab of the API call. Click on the +Add New Alert button to invoke the dialog.
The alert type can be via email or any of a number of Webhook services.
You can choose the trigger alert criteria (Pass, Slow, Warning, Error). Unless you are doing negative testing, you should typically untick the Pass box. You should also tick the Enable box, so that you receive alerts. If you want to stop receiving alerts, you can untick the box.
Enter a name for the alert and choose a value for X. The default is 20, which can be appropriate if you only want to be alerted if the API is failing for a significant number of calls in a row. Often a single failure does not indicate a fundamental problem with the API.
If you want to a Webhook, choose the particular service you wish to integrate. Each service requires slightly different parameters, so check which ones the service you want to use needs. In the case of PagerDuty, for instance, you will need to enter a valid Integration key. Typically, you would want to edit the Trigger alerts as you wouldn't normally want to alert on
To set alerts globally, click on the Alerts & Webhooks section of the side navigation and fill in the dialog. By default, you will create alerts for al the APIs you monitor.
By default, alerts are sent by email. Alerts can also trigger a Webhook event (see above).