With “Alarms” ServisBOT provides live monitoring of Bot experiences with real time bot metrics & business goals. Metrics can be evaluated as frequently at 15 minutes or 1 hour intervals. A schedule can be set to cover each hour and day of the week. And when an alarm triggered, users subscribed to the alarm will be notified.
Alarms can be used for many use cases i.e.
It is possible to perform actions associated with alarms in the cli by using sb-cli alarm <command>
. The possible commands are listed below.
sb-cli alarm create <json> Creates an alarm from inline JSON or a file
[aliases: c]
sb-cli alarm delete <alarm_id> Deletes an alarm with the given alarm ID
[aliases: d]
sb-cli alarm describe <alarm_id> Describes an alarm with the given alarm ID
[aliases: desc]
sb-cli alarm list [type] Lists all alarm ids, display names, and descriptions
[aliases: l]
sb-cli alarm trigger-subscriptions Triggers all the subscriptions for
<alarm_id> an alarm with the given alarm id, as if it had alarmed
[aliases: trigger]
sb-cli alarm update <json> Updates an alarm from inline JSON or a file
[aliases: u]
To create an alarm using the CLI command sb-cli alarm create <json>
you must either create the alarm from an inline JSON, or enter the relevant file path. The JSON should be formatted as follows:
{
"displayName": "exampleAlarm",
"enabled": true,
"description": "my example alarm",
"projects": [],
"frequency": "15mins",
"query": {
"responsePath": "businessGoalMetricsTotals.conversation_engaged.count",
"goal": "conversation_engaged",
"resourceName": "BotName",
"resourceType": "Bot",
"metricType": "BusinessGoals"
},
"scheduleConfig": {
"timezone": "Europe/Dublin",
"schedule": {
"wednesday": {
"9-10": {
"min": 0,
"max": 0
},
"14": {
"min": 0,
"max": 0
}
}
}
},
}
The table below describes which fields are required.
Field | Required or Optional | |
---|---|---|
displayName | Required | Human readable name, accepts spaces. |
enabled | Optional (default true) | True or false |
description | Optional | Internal values |
projects | Required | A reference to a project in the same org that will be checked |
frequency | Required | How often the alarm should run. hourly or 15mins . Make sure the schedule’s min and max data are appropriate for the data expected for your total period. |
query | Required | Query run to check the alarm, only business goal calculation are supported. If the buisness goal has a space in it, include that space here. For example, "businessGoalMetricsTotals.My Goal.count" and "My Goal" . |
scheduleConfiq | Required | Schedule - an object containing the alarm schedule configuration. |
After creation the alarm will have an autogenerated ‘id’ field which is required to subscribe to the alarm
Each key in this object can be a day of the week in long form. Possible values are
period
. The possible statistic functions are as follows:
To subscribe to an alarm a project must be first setup.
To setup a project use the sb-cli project create
command with a json file detailing the project.
Example:
{
"Alias": "my_first_project",
"Configuration": {
"Monitoring": {
"Alarms": [
{
"Id": "alarm_id", // The autogenerated id field of the alarm
"Subscribers": [
{
"Properties": {
"Body": "<h2>ServisBOT Alert</h2>{Description}<br><body>AlarmId: {AlarmId}<br>AlarmState: {AlarmState}<br>PreviousState: {PreviousState}<br>MetricValue: {MetricValue}</body>",
"Emails": [
"your_email@email.com"
],
"Subject": "ServisBOT Alarm - {AlarmId}: {AlarmState}"
},
"Type": "Email"
}
]
}
]
}
},
"Version": "$LATEST"
}
After the project is created update the alarm with a projects key as follows:
{
"id": "alarm_id", // autogenerated field
"displayName": "exampleAlarm",
"enabled": true,
"description": "my example alarm",
"projects": [
{"name": "my_first_project"}
],
"frequency": "15mins",
"query": {
"responsePath": "businessGoalMetricsTotals.conversation_engaged.count",
"goal": "conversation_engaged",
"resourceName": "BotName",
"resourceType": "Bot",
"metricType": "BusinessGoals"
},
"scheduleConfig": {
"timezone": "Europe/Dublin",
"schedule": {
"wednesday": {
"9": {
"min": 0,
"max": 0
},
"10": {
"min": 0,
"max": 0
}
}
}
},
}