An Azure SQL Database named db-billing runs heavy batch jobs every night, so its CPU percentage is high at night and low during the day. A fixed CPU limit has produced false alerts at night and missed problems during the day.
You must create a metric alert rule on db-billing in the Azure portal that meets these requirements:
- The threshold is calculated from the learned behaviour pattern of the CPU percentage metric, not from a fixed value.
- The rule fires only when CPU is abnormally high, never when it is abnormally low.
- The rule produces as few alerts as possible, firing only on large deviations.
- Notifications use the existing action group ag-dba-oncall.
Which actions should you perform, and in which order?
You didn't answer this one.
Dynamic thresholds learn the metric's behaviour pattern, including seasonality such as nightly batch load, and calculate thresholds from it rather than from a fixed value. With a dynamic threshold, the operator decides whether the upper bound, the lower bound or both are evaluated, and the default evaluates both. Choosing only the upper bound limits the rule to abnormally high CPU. Low sensitivity uses loose thresholds that fire only on large deviations, which produces the fewest alerts. The rule is then linked to the existing action group and created.
- Step 1: In the Azure portal, open db-billing and, in the resource menu under Monitoring, select Alerts. The alert rule is started from the database's Alerts page. Nothing in the rule wizard is available before this page is open.
- Step 2: Select + Create, and then select Alert rule. The + Create button is on the Alerts page from the previous step. Selecting Alert rule opens the Create an alert rule page, scoped to db-billing.
- Step 3: On the Condition tab, select See all signals, select the CPU percentage metric, and then select Apply. The Condition tab belongs to the Create an alert rule page from the previous step. A metric signal must be selected before any alert logic options appear.
- Step 4: In the alert logic, set Threshold to Dynamic, set Operator to Greater than the upper threshold, and set Threshold sensitivity to Low. Alert logic appears only after a signal is applied. Dynamic meets the learned-pattern requirement. Greater than the upper threshold limits alerts to high CPU. Low sensitivity fires only on large deviations, giving the fewest alerts.
- Step 5: Select Next: Actions, select the existing ag-dba-oncall action group, select Next: Details, enter an alert rule name, select Review + create, and then select Create. Creating the rule before the threshold settings are made would produce a rule that breaks the threshold, direction and alert-volume requirements. Selecting ag-dba-oncall meets the notification requirement.
- Not needed: Set Threshold to Static, Aggregation type to Maximum, Operator to Greater than, and Threshold value to 80. A static threshold compares the metric with a fixed value. That breaks the requirement to calculate the threshold from the learned behaviour pattern.
- Not needed: Keep the default dynamic Operator, which evaluates both the upper bound and the lower bound. The default operator also fires when CPU falls below the lower bound. That breaks the requirement to alert only on abnormally high CPU.
- Not needed: Set Threshold sensitivity to High. High sensitivity uses tight thresholds that fire on the smallest deviation, which gives more alerts. That breaks the requirement to fire only on large deviations.