Uptime & Heartbeat Monitors
Integrations
IBM Cloud Functions Integration
IBM Cloud Function provides a service to run your application code without servers, scale it automatically, and pay nothing when it's not in use, with integrations with IBM Cloud services.

In iLert

  • Go to the "Alert sources" tab and click "Create new alert source"
  • Enter a name and select your desired escalation policy.
  • Select "IBM Cloud Functions" as the Integration Type and click Save.
  • On the next page, an IBM Cloud Functions URL is generated. You will need the URL for the webhook configuration

In IBM Cloud Functions

  • On IBM Cloud Functions dashboard, create an Action by clicking "Actions" -> "Create"
  • Choose the name of your choice, in this case we will name it as "ilert-incidents", and choose "Node.js 12" as a runtime
  • Paste the following on the code, and please replace the "ILERT_URL" with the IBM Cloud Functions URL that we got earlier on iLert's dashboard
1
/**
2
*
3
* main() will be run when you invoke this action
4
*
5
* @param Cloud Functions actions accept a single parameter, which must be a JSON object.
6
*
7
* @return The output of this action, which must be a JSON object.
8
*
9
*/
10
const request = require('request-promise');
11
12
function main(params) {
13
14
if (!params.apiKey || !params.summary || !params.details) {
15
throw new Error("params need to include 'apiKey', 'summary', and 'details'");
16
}
17
18
if (!params.eventType) {
19
params.eventType = "ALERT";
20
}
21
22
console.log(`params: ${JSON.stringify(params)}`);
23
24
// Set request options
25
const options = {
26
url: 'ILERT_URL',
27
method: 'POST',
28
json: true,
29
body: params
30
};
31
32
// Make POST request
33
return request(options)
34
.catch((error) => {
35
throw error;
36
});
37
}
38
Copied!
  • To trigger it, we need to pass the params, in this case click on "Invoke with parameters" on top right
  • Put the following as a parameter, you can adjust the summary and details, however please replace the "API_KEY" with the IBM Cloud Functions API Key that we go on iLert's dashboard earlier and Apply the parameters
1
{
2
"apiKey":"API_KEY",
3
"eventType": "ALERT",
4
"summary": "Test IBM Function",
5
"details": "Test IBM Function success"
6
}
Copied!
  • To trigger the creation of incidents on iLert simple click "Invoke" on the top right, and it should create the incident on iLert

FAQ

  1. 1.
    How to trigger the incident creation from other service?
    For more information about invoking from trigger in IBM Cloud Service, please refer to IBM Documentation: https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-triggers
  2. 2.
    Is it possible to manage the incident, for example to accept or resolve the incident?
    Yes it is possible if the eventType is passed with value ACCEPT or RESOLVE, this should accept and resolve the issue respectively. In addition to that, you need to pass the incidentKey parameter on creation as well. All the parameter on event creation will be accepted. For more information, please refer to our API Documentation: https://api.ilert.com/api-docs/#tag/Events/paths/~1events/post
Last modified 1mo ago
Copy link
Edit on GitHub