Step 2. Add an alert
Published 21 October 2021
Adding an alert to a custom metric is optional, but it means you'll be notified if the metric value passes certain thresholds and durations.
If you don't want to add an alert, click Next and go to Step 3. Create. If you do, turn on the Add a custom alert for this metric checkbox.
Enter custom alert details
Adding an alert name is compulsory, because it is the unique identifier for that alert in SQL Monitor. The name can contain up to 255 characters.
The alert description is optional but recommended because it helps users understand what conditions may cause the alert to be raised. It is displayed in the Description tab on the Alert details page and the Description section on the alert configuration page.
Define alert thresholds
SQL Monitor needs to know whether you want to be alerted when metric values go higher or lower than your defined thresholds, so that it knows the direction in which alerts should be raised and escalated.
- In most cases, you want to be alerted when values go higher than the threshold, so Above the defined thresholds is the default selection. The alert will only be raised or escalated if the value increases. For example, an alert based on database size may be raised as Low if it passes a 5 GB threshold, then escalated to Medium if it increases and passes above a 7 GB threshold:
- In some cases, you want to be alerted when values go Below the defined thresholds. For example, to raise alerts when the amount of disk space available falls below a certain size may be raised as Medium if it passes a 15 GB threshold, then escalated to High if it decreases and passes below a 10 GB threshold.
You do not have to enable every threshold, but you must add values to the enabled levels. In the Alert Inbox, the alert level will change automatically as the different thresholds are passed. This allows you to keep track of how serious the problem is, and to prioritize queries for investigation that have escalated to High.
If initial threshold settings don't suit your environment when put into practise, you can change them using the alert configuration page.
Set alert threshold duration
By default, alerts are raised every time the metric passes the defined thresholds. Sometimes this behaviour isn't ideal, for example when you're collecting metrics every minute from a database for which occasional spikes are normal. You want to see these spikes on the analysis graphs, but you don't want them to trigger an alert unless the threshold is passed for three or more consecutive collections.
To change the default behaviour, add a suitable value to the Raise an alert when the threshold is passed for <n> collections option. Text displayed in this section confirms the metric collection frequency specified in Step 1. Define metric, and the total time range after which alerts can be raised:
Alerts can only be raised if the metric passes a threshold value at the time it's collected. If a spike occurs between collections, they won't be displayed on the analysis graphs and can't trigger alerts. If you suspect spikes are occurring outside collection times, consider editing your custom metric configuration to collect data more frequently.
Once you've completed this page, click Next to go to Step 3. Create.