Alerts

Introduction

Knowi's Alerts allows you to stay on top of important changes in your business in a centralized location to drive actions. With Alerts, you can enhance data management by monitoring query execution, receive real-time notifications when certain thresholds and conditions are met, or when anomalies are detected within your data.

For example- let's assume you have a widget tracking Apple's stock price that includes a date field and daily close price.



Let's say you'd like to generate an alert when the stock price at Close exceeds 160.00. You can create an alert based on this threshold and have it sent to you via email/webhook/Slack when the condition is triggered, including the results of your condition.

There are three main alert types you can configure depending on your use case. The sections below will guide you through setting up and managing them.



Data Update Alerts

For datasets that use the ElasticStore to track results, use Data Update Alerts to raise alerts when the data is not updated upon an expected interval. For example- if a query didn't execute as scheduled, this will trigger an alert that can be sent via email/webhook/Slack.


Sections


Creating a Data Update Alert

This outlines initial steps to create the alert.

  1. From any dashboard, click the Alerts icon on the left sidebar
  2. In the Alerts Management screen, Click Add Data Update Alerts +
  3. This opens the Alerts Options window
  4. Give your Alert a name. This is how it will be displayed in Alerts Management
  5. In the Dataset dropdown, select the dataset to create an alert for
  6. Adding Filters: Users can add filters to the query. Click + to add a filter and - to remove. There are two modes to choose from: Query Parameter and Filter on Query Results.

    • Query Parameter - Applicable for "Direct Query" modes, the parameters selected will be automatically passed on to this user. The field name must be in the format $c9_XXX$ or $c9_XXX(defaultVal)$, where the default value will be passed at runtime if the value is empty. To add multiple values, add the value and hit enter.

    • Filter on Query Results - Applies the filter on top of the query results to limit the data. The field name is the field name to filter by (without $c9_). Enter the value, data type, and operation type.

  7. In the Run Every section, schedule the alert to run at a chosen interval
  8. Skip Alert if data is same as last alert: Check this box to skip this alert If the data is the same as the last alert. Useful to avoid repetitive alerts
  9. Select an Alert Action to configure alert to be sent via email/webhook/Slack

Creating a Query Error Alert

Follow these steps to notify users of a query failure.

  1. Click Queries from the left sidebar.
  2. Click Query Details from any of the queries.
  3. On the query's dataset management page, click More...
  4. Click Add Query Error Alert.
  5. On the Create Alert page, give the alert a name, and choose the dataset.
  6. Adding Filters: Users can add filters to the query. Click + to add a filter and - to remove. There are two modes to choose from: Query Parameter and Filter on Query Results.

    • Query Parameter - Applicable for "Direct Query" modes, the parameters selected will be automatically passed on to this user. The field name must be in the format $c9_XXX$ or $c9_XXX(defaultVal)$, where the default value will be passed at runtime if the value is empty. To add multiple values, add the value and hit enter.

    • Filter on Query Results - Applies the filter on top of the query results to limit the data. The field name is the field name to filter by (without $c9_). Enter the value, data type, and operation type.

  7. Set up the alert notification to receive an alert whenever the query fails.
  8. In addition, you can add tokens that would help provide better context on the query failure.

Tokens:

%QUERY_ERROR_MESSAGE%: Returns the query error message %QUERY_ERROR_STACK_TRACE%: returns the query error stack trace as a string.

Note: This is available for non-direct queries only


Alert Actions


Email

Email Alerts allows you to send the alert via email along with a CSV attachment of results to a list of recipients.

To set up an Email Alert:

  1. Under Alert Actions, select the Send Email tab.
  2. Enter the Email Subject that will be displayed.
  3. Click on the Add Email From to enter the email address that the email will be sent from ([email protected] by default). This address will appear as the sender of the email when received in your inbox.
  4. Under Recipient List, enter the email address of the recipient(s). Comma separated for multiple recipients.
  5. Under Email Template, enter the Email Body. (optional) Write custom HTML to customize the email template.
  6. Click Test Run (optional) to send a test email alert to the chosen recipient(s).
  7. Once configuration is complete, click Save.
Webhook

Webhook Alerts allow you to send an alert directly to your application (or third party applications). We'll send a POST request with a JSON payload of the data, which you can use to drive actions within your application. 

The data in the POST will be a JSON formatted dataset of the full raw dataset for which the alert is generated.

To set up a Webhook Alert:

  1. Under Alert Actions, select Webhook and click on the + Add Webhook to open the Add Webhook window.

  2. Under Name, enter the name of the webhook.

  3. Under URL to Invoke, enter the endpoint in your application that can accept a post request with JSON (Array of Objects). For example: https://webhook.site.

  4. Under the Authentication URL, enter the authentication endpoint to get a token, which can be passed into each subsequent query. Only required if the API requires it. This is an absolute URL.

  5. Under Headers, enter any headers for HTTP requests to the URL to Invoke endpoint. There can be one header per line.

    Knowi also provides the following C9 tokens which can be used to identify the report on the Webhook headers.

    • $c9_taskDate$: It denotes the date of the alert in the (yyyy-mm-dd) format
    • $c9_taskName$: It defines the name of the webhook alert. For example: Test webhook
    • $c9_taskId$: It denotes any Id of the alert. For example: 2971
    • $c9_taskType$: This can be either report or alert

  6. Under Auth Headers, enter any optional authentication-related headers. One header per line.

  7. Under the Custom POST Body, the user can pass data tokens through the webhook using the POST Body field. Enter a custom post body to be sent out. Data tokens can pass field values from data. If left empty, the post body for the webhook will contain the conditional data saved as JSON or just a default message with the dataset name triggered.

    For example,

    For sending activity samples, we can type %opened% or %customer%, etc., and it will be replaced with the value of the fields of the first row of triggered data.

    Note: The data of token only can pass first record of triggered alert/report data (or conditional data alerted)

  8. Click Save.

  9. Click Test Run (optional) to send a test webhook alert to the chosen application. Here is an example of the results in JSON form:

  10. Once configuration is complete, click Save.

Slack


Slack integration allows you to trigger actions in your Slack channel(s) for a given condition triggered by an alert. When the condition is triggered, we'll send a message to a predefined channel(s) including the attachment of full data or conditional data depending on the options selected.

To set up a Slack Alert:

  1. Under Alert Actions, select the Slack tab.
  2. If this is your first time connecting Knowi to Slack, click the New Team icon. Follow the prompts to give Knowi access to your Slack account.
  3. Click + Add Slack. This opens up the Add Slack sidebar.
  4. Give your Alert a name.
  5. Under Alert Message, enter a user defined message that will show up when the Alert is received in Slack. If left blank, it will send a default message.
  6. In the Alert Team dropdown, choose the Slack workspace to send the Alert to.
  7. In the Alert Channels dropdown, choose the Slack channel to publish the Alert notifications to.
  8. Send a slack message for each row of alert data (optional): Check this box to send a slack message for each row of alert data.
  9. Click Save.
  10. Click Test Run (optional) to send a test Slack alert to the chosen channel(s). Here is how the Alert will show up in you Slack channel:

  11. Once configuration is complete, click Save.

Teams


MS Teams integration allows you to trigger actions in your Teams channel(s) for a given condition triggered by an alert. When the condition is triggered, we'll send a message to a predefined channel(s) including the attachment of full data or conditional data depending on the options selected.

To set up a Teams Alert:

  1. Under Alert Actions, select the Teams tab.
  2. Click + Add Teams. This opens up the Add Teams sidebar.
  3. Give your Alert a name.
  4. Under Alert Message, enter a user defined message that will show up when the Alert is received in Teams. If left blank, it will send a default message.
  5. In the Alert Team dropdown, choose the Teams workspace to send the Alert to.
  6. In the Alert Channels dropdown, choose the Teams channel to publish the Alert notifications to.
  7. Click Save.
  8. Click Test Run (optional) to send a test Teams alert to the chosen channel(s).
  9. Once configuration is complete, click Save.

Trigger Notification Alerts

Trigger Notifications allows you to set powerful triggers on your datasets to drive actions based on a custom condition you specify. The notifications along with results can be sent via email/webhook/Slack.


Sections

Creating a Trigger Notification Alert

This outlines initial steps to create the alert.

  1. From any dashboard, click the Alerts icon on the left sidebar
  2. In the Alerts Management screen, Click Add Trigger Notification +
  3. This opens the Alerts Options window
  4. Give your Alert a name. This is how it will be displayed in Alerts Management
  5. In the Dataset dropdown, select the dataset to create an alert for
  6. In The condition * section, use Cloud9QL in the query editor to create the trigger condition on top of your dataset:
    • Enter the Cloud9QL query for your condition in the query editor
    • Click Preview to see the results of your Cloud9QL condition and edit if needed
  7. Click Use Query to use the query you have
  8. Adding Filters: Users can add filters to the query. Click + to add a filter and - to remove. There are two modes to choose from: Query Parameter and Filter on Query Results.

    • Query Parameter - Applicable for "Direct Query" modes, the parameters selected will be automatically passed on to this user. The field name must be in the format $c9_XXX$ or $c9_XXX(defaultVal)$, where the default value will be passed at runtime if the value is empty. To add multiple values, add the value and hit enter.

    • Filter on Query Results - Applies the filter on top of the query results to limit the data. The field name is the field name to filter by (without $c9_). Enter the value, data type, and operation type.

  9. Generate Alert if no data is detected: Check this box to raise the alert if no data is returned from the alert condition
  10. Attach conditional data as part of the alert: Check this box to attach the underlying dataset after the C9QL condition is applied as part of the alert
  11. Attach Full Dataset: Checking this box will send the full dataset as CSV
  12. Attach a Dashboard on trigger: Checking this box will enable users to attach a Dashboard as a PDF File. Note: Attaching a dashboard on the Webhook actions trigger is unsuitable.
  13. Enable realtime alerts: Check this box to trigger the alert every time the dataset is updated. Not available for direct datasets. If users want to receive alerts based on time period, leave the box unchecked and specify the Run Every box with a value with minutes, hours, days, or months option. Mention the timezone in which you want the alert to trigger.
  14. Skip Alert if data is same as last alert: Check this box so to skip this alert If the data is the same as the last alert. Useful to avoid repetitive alerts
  15. Select an Alert Action to configure alert to be sent via email/webhook/Slack


Alert Actions


Email

Email Alerts allows you to send the alert via email along with a CSV attachment of results to a list of recipients.

To set up an Email Alert:

  1. Under Alert Actions, select the Send Email tab.
  2. Enter the Email Subject that will be displayed.
  3. Click on the Add Email From section, enter the email address that the email will be sent from ([email protected] by default). This address will appear as the sender of the email when received in your inbox.
  4. Under Recipient List, enter the email address of the recipient(s). Comma separated for multiple recipients.
  5. Under Email Template, enter the Email Body. (optional) Write custom HTML to customize the email template.
  6. Click Test Run (optional) to send a test email alert to the chosen recipient(s).
  7. Once configuration is complete, click Save.
Webhook

Webhook Alerts allow you to send an alert directly to your application (or third party applications). We'll send a POST request with a JSON payload of the data, which you can use to drive actions within your application. 

The data in the POST will be a JSON formatted dataset of the full raw dataset for which the alert is generated.

To set up a Webhook Alert:

  1. Under Alert Actions, select Webhook and click on the + Add Webhook to open the Add Webhook window.

  2. Under Name, enter the name of the webhook.

  3. Under URL to Invoke, enter the endpoint in your application that can accept a post request with JSON (Array of Objects). For example: https://webhook.site.

  4. Under the Authentication URL, enter the authentication endpoint to get a token, which can be passed into each subsequent query. Only required if the API requires it. This is an absolute URL.

  5. Under Headers, enter any headers for HTTP requests to the URL to Invoke endpoint. There can be one header per line.

    Knowi also provides the following C9 tokens which can be used to identify the report on the Webhook headers.

    • $c9_taskDate$: It denotes the date of the alert in the (yyyy-mm-dd) format
    • $c9_taskName$: It defines the name of the webhook alert. For example: Test webhook
    • $c9_taskId$: It denotes any Id of the alert. For example: 2971
    • $c9_taskType$: This can be either report or alert

  6. Under Auth Headers, enter any optional authentication-related headers. One header per line.

  7. Under the Custom POST Body, the user can pass data tokens through the webhook using the POST Body field. Enter a custom post body to be sent out. Data tokens can pass field values from data. If left empty, the post body for the webhook will contain the conditional data saved as JSON or just a default message with the dataset name triggered.

    For example,

    For sending activity samples, we can type %opened% or %customer%, etc., and it will be replaced with the value of the fields of the first row of triggered data.

    Note: The data of token only can pass first record of triggered alert/report data (or conditional data alerted)

  8. Click Save.

  9. Click Test Run (optional) to send a test webhook alert to the chosen application. Here is an example of the results in JSON form:

  10. Once configuration is complete, click Save.

Slack


Slack integration allows you to trigger actions in your Slack channel(s) for a given condition triggered by an alert. When the condition is triggered, we'll send a message to a predefined channel(s) including the attachment of full data or conditional data depending on the options selected.

To set up a Slack Alert:

  1. Under Alert Actions, select the Slack tab.
  2. If this is your first time connecting Knowi to Slack, click the New Team icon. Follow the prompts to give Knowi access to your Slack account.
  3. Click + Add Slack. This opens up the Add Slack sidebar.
  4. Give your Alert a name.
  5. Under Alert Message, enter a user defined message that will show up when the Alert is received in Slack. If left blank, it will send a default message.
  6. In the Alert Team dropdown, choose the Slack workspace to send the Alert to.
  7. In the Alert Channels dropdown, choose the Slack channel to publish the Alert notifications to.
  8. Send a slack message for each row of alert data (optional): Check this box to send a slack message for each row of alert data.
  9. Click Save.
  10. Click Test Run (optional) to send a test Slack alert to the chosen channel(s). Here is how the Alert will show up in you Slack channel:
  11. Once configuration is complete, click Save.
Teams


MS Teams integration allows you to trigger actions in your Teams channel(s) for a given condition triggered by an alert. When the condition is triggered, we'll send a message to a predefined channel(s) including the attachment of full data or conditional data depending on the options selected.

To set up a Teams Alert:

  1. Under Alert Actions, select the Teams tab.
  2. Click + Add Teams. This opens up the Add Teams sidebar.
  3. Give your Alert a name.
  4. Under Alert Message, enter a user defined message that will show up when the Alert is received in Teams. If left blank, it will send a default message.
  5. In the Alert Team dropdown, choose the Teams workspace to send the Alert to.
  6. In the Alert Channels dropdown, choose the Teams channel to publish the Alert notifications to.
  7. Click Save.
  8. Click Test Run (optional) to send a test Teams alert to the chosen channel(s).
  9. Once configuration is complete, click Save.

Widget Alerts

Widget Alerts enable you to set up alerts directly on a widget based on a threshold, anomaly detected, or custom condition in your data and have the alert along with results sent via email/webhook/Slack.


Sections


To get started, navigate to the widget you want to create an alert for and click the Add/Remove Alert Icon. 



Creating a Threshold Widget Alert

  1. Navigate to the widget you want to create an alert for and click the Add/Remove Alert icon.
  2. Select Add Alert + to open the Create Alert sidebar. 
  3. Select the Threshold tab.
  4. Give your Alert a name. This is how it will be displayed in Alerts Management.
  5. In Alerts metric dropdown, select the field you want to set an alert on.
  6. Choose the the threshold type (i.e. >, >=, =, <=, <).
  7. In the Threshold box, enter the value that will trigger the alert.
  8. See section below for Advanced Settings.
  9. Select a Send Alert via action to configure alert to be sent via email/webhook/Slack/Teams.



Creating an Anomaly Detection Widget Alert

Time-series anomaly detection is used to identify unusual patterns that do not conform to expected behavior, called outliers. This alert notifies you when such anomalies are detected within your data.


  1. Navigate to the widget you want to create an alert for and click the Add/Remove Alert Icon.
  2. Select Add Alert + to open the Create Alert sidebar. 
  3. Select the Anomaly Detection (Beta) tab.
  4. Give your Alert a name. This is how it will be displayed in Alerts Management.
  5. In Alerts metric dropdown, select the field you want to set an alert on.
  6. Set the Anomaly Detection Threshold (default: 50). The threshold/band width determines the range of expected values. Values outside of the threshold are considered anomalies. 
  7. Select the Date/Time Dimension - this is the time series feature of the selected dataset, typically used as the x-axis of time-series charts.
  8. Select a Dimension to detect anomalies across other fields in your dataset.
  9. Use the Preview button to preview the anomaly detection model which is trained and applied to the data.
  10. Select the type of dimension from Dimension drop-down to see the specific values.
  11. See section below for Advanced Settings.
  12. Select a Send Alert via action to configure alert to be sent via email/webhook/Slack/Teams.



Creating a Custom Widget Alert

  1. Navigate to the widget you want to create an alert for and click the Add/Remove Alert Icon.
  2. Select Add Alert + to open the Create Alert sidebar. 
  3. Select the Custom tab.
  4. Give your Alert a name. This is how it will be displayed in Alerts Management.
  5. In the Cloud9QL condition editor, enter a custom alert condition syntax.
  6. The custom condition you have specified will trigger the alert.
  7. See section below for Advanced Settings.
  8. Select a Send Alert via action to configure alert to be sent via email/webhook/Slack/Teams.


Advanced Settings

These are additional options to configure your Alert. Check the Advanced Settings box to expand the menu.




Send alert via

This section will walk you through setting up Alert notifications for Widget Alerts.


Email

Email Alerts allows you to send the alert via email along with a CSV attachment of results to a list of recipients. 



To set up an Email Alert:

  1. Under Send alert via, select the Email tab, then click Setup.
  2. Enter the Email Subject that will be displayed.
  3. Under Recipient List, enter the email address of the recipient(s). Comma separated for multiple recipients.
  4. Click on the Add Email From to enter the email address that the email will be sent from ([email protected] by default). This address will appear as the sender of the email when received in your inbox.
  5. Enter the Email Body. (Optional) Write custom HTML to customize the email template
  6. Click Save Settings.
  7. Click Test Run (optional) to send a test email alert to the chosen recipient(s).
  8. Once configuration is complete, click Save Alert.
  9. You can add a new Alert or edit an existing one by clicking the Alert Icon in the widget.

Using C9_Date Tokens:

Users have the ability to specify the c9_date token in the alert email subject and body in the following format:

{$c9_:YYYYMMdd}

For example, {$c9_today-1d:YYYYMMdd} will be translated automatically to yesterday.

If the format is not specified (YYYYMMdd in the example above) - then the default user date-time format is applied.

For more information on supported date tokens and time units, you can refer to the Date Tokens section of our documentation.

Webhook


Webhook Alerts allow you to send an alert directly to your application (or third party applications). We'll send a POST request with a JSON payload of the data, which you can use to drive actions within your application. 

The data in the POST will be a JSON formatted dataset of the full raw dataset for which the alert is generated.

To set up a Webhook Alert:

  1. Under Send alert via, select the Webhook tab, then click Setup.

    This opens up the Create new webhook sidebar.

  2. Under Name, enter the name of the webhook.

  3. Under URL to Invoke, enter the endpoint in your application that can accept a post request with JSON (Array of Objects). For example: https://webhook.site.

  4. Under the Authentication URL, enter the authentication endpoint to get a token, which can be passed into each subsequent query. Only required if the API requires it. This is an absolute URL.

  5. Under Headers, enter any headers for HTTP requests to the URL to Invoke endpoint. There can be one header per line.

    Knowi also provides the following C9 tokens which can be used to identify the report on the Webhook headers.

    • $c9_taskDate$: It denotes the date of the alert in the (yyyy-mm-dd) format
    • $c9_taskName$: It defines the name of the webhook alert. For example: Test webhook
    • $c9_taskId$: It denotes any Id of the alert. For example: 2971
    • $c9_taskType$: This can be either report or alert

  6. Under Auth Headers, enter any optional authentication-related headers. One header per line.

  7. Click Create Webhook.

  8. Click Test Run (optional) to send a test webhook alert to the chosen application.

  9. Once configuration is complete, click Save.

  10. You can add a new Alert or edit an existing one by clicking the Alert Icon in the widget.


Slack

Slack integration allows you to trigger actions in your Slack channel(s) for a given condition triggered by an alert. When the condition is triggered, we'll send a message to a predefined channel(s) including the attachment of full data or conditional data depending on the options selected.



  1. Under Send alert via, select the Slack tab, then click Setup.
  2. If this is your first time connecting Knowi to Slack, click Add new Slack team. Follow the prompts to give Knowi access to your Slack account.
  3. Click Add New Slack Account. This opens up the Add Slack sidebar.
  4. Give your Alert a name.
  5. Under Alert Message, enter a user defined message that will show up when the Alert is received in Slack. If left blank, it will send a default message.
  6. In the Alert Team dropdown, choose the Slack workspace to send the Alert to.
  7. In the Alert Channels dropdown, choose the Slack channel to publish the Alert notifications to.
  8. Click Save Settings.
  9. Click Test Run (optional) to send a test Slack alert to the chosen channel(s). Here is how the Alert will show up in you Slack channel:
  10. Once configuration is complete, click Save Alert.
  11. You can add a new Alert or edit an existing one by clicking the Alert Icon in the widget.


Teams

Teams integration allows you to trigger actions in your Teams channel(s) for a given condition triggered by an alert. When the condition is triggered, we'll send a message to a predefined channel(s) including the attachment of full data or conditional data depending on the options selected.



  1. Under Send alert via, select the Teams tab, then click Setup.
  2. If this is your first time connecting Knowi to Teams, click Add new teams account. Follow the prompts to give Knowi access to your Teams account. This opens up the Add Teams sidebar.
  3. Give your Alert a name.
  4. Under Alert Message, enter a user defined message that will show up when the Alert is received in Teams. If left blank, it will send a default message.
  5. In the Alert Team dropdown, choose the Teams workspace to send the Alert to.
  6. In the Alert Channels dropdown, choose the Teams channel to publish the Alert notifications to.
  7. Click Save Settings.
  8. Click Test Run (optional) to send a test Teams alert to the chosen channel(s).
  9. Once configuration is complete, click Save Alert.
  10. You can add a new Alert or edit an existing one by clicking the Alert Icon in the widget.

Managing Alerts

All alerts are managed in a central location in the Alerts Management screen. From the dashboard, click on the Alerts icon on the left side panel. 



Sections


Creating a New Alert

You can create new alerts in Alerts Management by clicking the Add Trigger Notification + or Add Data Update Alerts + orange icons. Note that Widget Alerts must be created on the widget themselves.


Alerts List

The list of Alerts you have created are listed here, along with details about the alert. You can also edit, share, clone, or delete alerts here.


Alert Details


Edit an Alert

You can edit an alert by clicking the pencil icon on the right side of each alert listing.


Clone an Alert


To clone an alert:

  1. Click the 3-dot icon on the right side of the alert listing
  2. Select Clone
  3. Make any changes to the alert as needed
  4. Click Save
  5. The cloned alert will now appear in the Alert list


Delete an Alert


To delete an alert:

  1. Click the 3-dot icon on the right side of the alert listing
  2. Select Delete
  3. You will be asked to confirm if you want to delete the alert. To proceed, click OK


Pause an Alert

You can stop receiving an alert from Knowi temporarily. Whenever you need the alert, you can unpause it.


To pause an alert:

  1. Click the 3-dot icon on the right side of the alert listing
  2. Select Pause
  3. You will be asked to confirm if you want to pause the alert. To proceed, click OK


Share an Alert

You can explicitly share an alert with another user. Note that sharing is only available to users who have full access rights to the dataset being used for the alert. 


To share an alert:

  1. Click the 3-dot icon on the right side of the alert listing
  2. Select Share
  3. In the dropdown, select the user(s) to share the alert to Click Share


Webhooks, Slack, & Teams

In Alerts Management, you also see a list of all the Webhook, Slack & Teams alerts you've created. You can edit each entry by clicking the pencil icon on the right hand side of each line. You can also delete an entry by clicking the Delete icon. 


Email Alert Template and Tokens

For alerts sent via email, you have the option to write custom HTML to customize the body of the email template. The body can contain the dynamic tags below:


%DATASET_NAME%

%ALERT_CONDITION%

%ALERT_HUMAN_READABLE_CONDITION%

%DATASET_LAST_UPDATE%

%COLUMN_NAME%

%DATA_CSV%

%DATA_JSON%

%QUERY_ERROR_MESSAGE%

%QUERY_ERROR_STACK_TRACE%


For example, using the default HTML payload template for a Trigger Notification Alert:


Will produce an email alert body that looks similar to the image below: