Configuring alerts in Insights
Insights allows you to configure alerts. Alerts monitor specified metrics and notify you when they reach a certain threshold. For example, you can configure an alert to notify you when a build of any of your apps exceeds 15 minutes or consumes more than a 1000 credits.
You can configure alerts for:
-
Builds
-
Tests
-
Credit usage
For each category, you can set alerts for any of the available metrics: Available metrics in Insights.
For each alert, you have to choose how to receive the notification. There are three options:
-
Microsoft Teams: The alert will post a notification to a Teams channel of your choice. You need to configure incoming webhooks in Teams.
-
Slack: The alert will post a notification to a Slack channel of your choice. You need a Slack app with incoming webhooks enabled.
-
Email: The alert will notify you via email.
Creating a new alert
You can create a new alert at any time in Insights:
-
Open Insights for your app.
-
Go to the Create alert page. To do so, you have two options:
-
Select
from the left menu and click on . -
Click on the bell icon above any metric in Builds, Tests, or Credits.
-
-
Choose a metric type and a specific metric within that type in the Metric type section.
You can choose from three main types:
-
Credit usage
-
Set filters in the Filters section.
You can configure the alert to apply to every single app in the Workspace, or you can filter it to a specific app, a Pipeline, a Pipeline Stage, a Workflow, or even a Step. You can also filter for branches, stacks, and machine types.
-
In the Threshold section, choose a threshold.
The threshold is the value that needs to be exceeded for the alert to fire. The exact nature of it depends on the metric you chose: for example, if you chose credit usage, you can set an amount of credits consumed to trigger an alert.
-
Choose the time period for the selected metric in the
menu.For example, you can configure an alert to notify you if the build failure rate for builds over the last month goes above 10%.
When are notifications sent?
Insights alerts send notifications based on the granularity setting:
-
Last one hour: after the data for the given hour is complete. If triggered, the notification will be sent out when the next hour started
Last one day: after the data for the given day (in UTC) is complete. If triggered, the notification will be sent out on the next day morning at 6:00am UTC.
Last one week: after the data for the given week (in UTC) is complete. If triggered, the notification will be sent out on the next Monday at 6:00am UTC.
Last one month: after the data for the given month (in UTC) is complete. If triggered, the notification will be sent out on the first day on the next month at 6:00am UTC.
-
-
In the Notification section, name the alert in the Alert name field.
-
In the Notification providers section, click and choose between three notification providers from the dropdown menu:
-
Slack: Create an incoming webhook that posts into a selected channel and paste the webhook URL. To do so, you need to create a Slack app and enable incoming webhooks in the app: Sending messages using incoming webhooks.
-
Teams: Create an incoming webhook for a selected Teams channel and paste the webhook URL: Create incoming webhooks for Teams.
-
Email: Set a valid email address. The alert will send a notification to the address.
-
-
When you're ready, click
to finish the alert.
Editing an existing alert
Once an alert is in place in Insights, you can modify it at any time from the Alerts page. You can change the threshold, the granularity (the time period the alert applies to), or modify the notification providers.
Metric type can't be changed
You can't modify the metric type that the alert monitors. For example, if the alert is monitoring build failure rate, you can't change it to monitor credit usage instead. Similarly, you can't change the filtering: if you were monitoring a specific app, you can't change the alert to monitor a different app instead.
If you need a similar alert for a different metric or with a different filter, duplicate the existing alert: Duplicating an existing alert.
To edit an alert:
-
Open Insights for your app.
-
On the left, select Alerts.
-
Select the alert you need and on the right, click the
button. -
On the alert's page, click the ellipsis in the top right corner to open the context menu.
-
Select Edit alert.
-
Modify the threshold, the granularity, or the notification provider.
-
Click
.
Duplicating an existing alert
You can duplicate any existing alert and then modify it during the alert creation process. This allows users to quickly create new alerts based on existing ones.
To duplicate an alert:
-
Open Insights for your app.
-
On the left, select Alerts.
-
Select the alert you need and on the right, click the
button. -
On the alert's page, click the ellipsis in the top right corner to open the context menu.
-
Select Duplicate.
-
The duplicate feature takes you to the Create alert page, with the existing alerts values already set. Make your changes and then click at the bottom of the page.