Real-time Alerts and Signals - Usage
Real-time Usage and Revenue Alerts and Signals
Amberflo can send alerts and signals via email and Webhooks.
A signal can be defined on a specific customer, or on all customers.
A signal rule can be defined as exceeding a constant number or a percentage change of metered data over time.
Signals can be defined on billing data as well to enable valuable alerts to customers, sales teams, and finance teams.
Signal examples:
- Get an email for any customer that exceed 1000 hours per week.
- Get a slack message for any customer that used 20% less week over week.
- Account manager receives email whenever customer usage surpasses amount of prepaid credits in Wallet.
- Head of Finance receives email alert when 25, 50, 75, and 90 percent of quarterly revenue target is reached.
The easiest way to configure Alerts & Signals is via the Console.
Property | Description | Required | Type |
---|---|---|---|
name | Name of the notification. This must be unique. | Yes | string |
meter_id | id as defined in meter-definition API. | Yes | string |
cron | Cron expression for the schedule. See for details https://crontab.guru/examples.html | No - Default is hourly | string |
webhook_url | Web hook url endpoint. Make a POST http request to this url. | Either webhook_url or email | string |
webhook_headers | Stringified JSON for headers with keywords. See keywords below. | No | string |
webhook_payload | Stringified json with keywords. See keywords below. | No | string |
Email address. | Either webhook_url or email | string | |
threshold_condition | Options: less-than, greater-than, percent-change | Yes | string |
threshold_value | Threshold value. | Yes | integer/float |
range | Aggregation bucket. Options: hour, day, week, month | Yes | string |
tenant | Options: "per-tenant" runs aggregation per tenant "*" aggregates for all tenants "Wayne Enterprises, Inc." run aggregation for specific tenant as defined in the customerName of customer details API. | No - Default is "*" for all tenants | string |
enabled | Yes | boolean |
Supported keywords for web hook:
Keyword | Description |
---|---|
{{tenant}} | customerName from customer details API |
{{meter-id}} | ID from meter definition API |
{{meter-name}} | meterApiName from meter definition API |
{{notification-id}} | notification ID |
{{notification-name}} | notification name |
{{current-value}} | current aggregated value of the meter |
{{threshold-value}} | threshold_value as defined in notification API |
{{threshold-condition}} | threshold_condition as defined in notification API |
{{ui-hyperlink}} | Amberflo UI dashboard link to view the usage data for the alert |
Sample webhook_payload
{
text: "Amberflo Notification {{notification-name}} ",
blocks: [
{
type: "section",
text: {
type: "mrkdwn",
text: "Amberflo notification: {{notification-name}}"
}
},
{
type: "section",
block_id: "section567",
text: {
type: "mrkdwn",
text: "Your meter value has exceeded the allowed threshold limit."
}
},
{
type: "section",
block_id: "section789",
fields: [
{
type: "mrkdwn",
text: "*Tenant*\n {{tenant}}"
},
{
type: "mrkdwn",
text: "*Meter*\n {{meter-name}}"
},
{
type: "mrkdwn",
text: "*Threshold condition*\n {{threshold-condition}}"
},
{
type: "mrkdwn",
text: "*Threshold limit*\n {{threshold-value}}"
},
{
type: "mrkdwn",
text: "*Current value*\n {{current-value}}"
}
]
},
{
type: "section",
block_id: "section790",
text: {
type: "mrkdwn",
text: "<{{ui-hyperlink}}|Click here to view usage details>"
}
}
]
}
Rendered slack message
POST https://app.amberflo.io/notification
{
"name": "api calls over 1000",
"meter_id" : "{{meter_id}}",
"cron": "0 0 * * 0",
"webhook_url": "https://hooks.slack.com/services/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",
"email":"[email protected]",
"threshold_condition": "greater-than",
"threshold_value": "1000",
"range":"day",
"tenant":"per-tenant",
"enabled": true
}
Updated 5 months ago