Custom alert rules allow you to monitor task run status and resource usage based on your business requirements, so you can promptly detect and handle exceptions. This topic describes how to create custom alert rules on the Rule Management page and how to obtain a webhook URL by adding a DingTalk chatbot.
Limitations
Custom alert rules apply only to auto-triggered Scheduled Instance. They do not monitor the results of test runs or data backfill tasks.
Custom alert rules support notifications by Email, SMS, phone call, DingTalk Chatbot, and Webhook. The following limitations apply:
Telephone: Phone call notifications are supported only for mobile phone numbers in the Chinese mainland.
Webhook:
DataWorks Basic Edition supports sending alerts to DingTalk, Lark, and WeCom groups by using group webhooks.
DataWorks Enterprise Edition also supports user-defined webhooks for receiving alerts.
NoteIf you want to send messages by using a custom webhook, adapt it by following the instructions in Custom webhooks for intelligent monitoring. After you complete the adaptation, contact us for further assistance.Submit a ticket to contact us.
Only DataWorks Professional Edition and higher support trigger conditions such as number of instances with errors, proportion of instances with errors, and node logs contain keywords. For more information, see Features of DataWorks editions. To subscribe to DataWorks, see Subscription.
Only the owner of the monitoring rule, a tenant administrator, or the Alibaba Cloud account can modify the monitoring rule.
Notes
When you monitor scheduled instances by using a custom alert rule, the monitoring time range varies based on the trigger condition.
Monitoring scope | Trigger condition | Description |
Business date (yesterday, T) |
| DataWorks monitors scheduled instances whose business date is yesterday and whose scheduled time is today. An alert is triggered when the trigger condition is met. |
Business date (yesterday T) and the day before yesterday (T-1) |
| DataWorks monitors scheduled instances whose business date is yesterday or the day before yesterday and whose scheduled time is today or yesterday. An alert is triggered when the trigger condition is met. |
Business date (yesterday T), the day before yesterday (T-1), and two days before yesterday (T-2) |
| DataWorks monitors scheduled instances whose business date is yesterday, the day before yesterday, or two days before yesterday and whose scheduled time is today, yesterday, or the day before yesterday. An alert is triggered when the trigger condition is met. |
Scheduled instances outside the monitoring scope do not trigger alerts even if the trigger condition is met. For details about the monitoring rules for different trigger conditions, see Configure trigger methods.
Go to Rule Management
Go to the Operation Center page.
In the left-side navigation pane, click .
NoteYou can also go to the Scheduled Tasks page to select nodes in batches and create monitoring rules. For more information, see Create monitoring rules for scheduled tasks.
Log on to the DataWorks console, switch to the target region, and then click in the left-side navigation pane. Select the target workspace from the drop-down list and click Operation Center.
Create a custom rule
On the Rule Management page, you can create custom monitoring rules as needed.
Configure basic information
Parameter | Description |
Rule Name | Enter a name for the custom rule. |
Object Type | Specify the type of the monitoring object to define the monitoring granularity. Valid values: Node, Baseline, Workspace, Workflow, Exclusive Resource Group for Scheduling, and Exclusive Resource Group for Data Integration. Note When the object type is baseline, only the run status of tasks on the baseline is monitored. Upstream tasks of baseline tasks are not monitored. If you also want to monitor upstream tasks of baseline tasks, see Intelligent baseline. |
Rule Object | Specify the monitoring objects. Enter the name or ID of a monitoring object, select the desired object from the list, and then click Add. The supported monitoring object types and their maximum quantities are as follows:
|
Task Blacklist | Specify which tasks among the monitoring objects are excluded from the current rule. When Object Type is set to Baseline, Workspace, or Workflow, you can enter a node name or ID and click Add to add the task to the blocklist. Note Tasks in the blocklist are not monitored. You can add up to 50 tasks to the blocklist. |
Resource Group Name | Specify the name of the exclusive resource group to monitor. When Object Type is set to Exclusive Resource Group for Scheduling or Exclusive Resource Group for Data Integration, select the Resource Group Name to monitor from the drop-down list. |
Configure trigger methods
In the custom alert logic, a frozen task is considered complete.
Object type | Trigger condition | Description |
Node, Baseline, Workspace, Workflow | Complete | The system monitors a task from the time it starts running. An alert is sent when the task runs successfully.
Note For hourly tasks, the task is considered complete only after all cycles run successfully. |
Incomplete | The system monitors a task from the time it starts running. If the task has not finished running by the specified target time, an alert is sent. Note This alert differs from the intelligent baseline alert policy. An intelligent baseline can detect exceptions that may prevent tasks on the baseline from being completed on time and send early warnings. For more information, see Intelligent baseline. Examples:
Note For hourly or minute-level tasks, the system checks whether all cycles have not been completed by the specified time on that day. | |
Error | The system monitors a task from the time it starts running. If the task encounters an error, an alert is sent. Note An instance run error means that the target instance shows the
| |
Number of instances with errors | Indicates the number of instances in the error state, including instances that fail Data Quality checks and instances that fail due to code logic errors. When the object type is Workspace and the Trigger Condition is set to Instances with Errors, you must configure a threshold. An alert is triggered when the number of instances with errors reaches the threshold. Note
| |
Proportion of Instances with Errors | When the object type is Workspace and the Trigger Condition is set to Proportion of Instances with Errors, you must configure a threshold. An alert is triggered when the proportion of instances with errors to the total number of instances today reaches the threshold. Note
| |
Node Logs Contain Keywords | When the object type is Workspace and the Trigger Condition is set to Node Logs Contain Keywords, you must configure keywords. An alert is triggered when the runtime logs of tasks today contain the specified keywords. Note
| |
Incomplete in Cycle | The system monitors a task within a specified cycle. If the task has not finished running within the cycle, an alert is sent. This condition is typically used for instances scheduled on an hourly basis. When a workflow is configured with the Incomplete in Cycle monitoring condition, the system monitors the Nth cycle of tasks in the workflow (such as daily, hourly, and minute-level tasks) based on the cycle N you specify. If the number of instances is less than N, the alert for that task is ignored. For example, if the cycle is set to 3, the workflow contains the following two tasks, and the alert monitoring works as follows:
| |
Timeout | The system monitors a task from the time it starts running. If the task has not finished running after the specified duration, an alert is sent. This condition is typically used to monitor task duration. | |
Error Persisting After Automatic Rerun of Node | The system monitors a task from the time it starts running. If the task encounters an error and still fails after automatic reruns, an alert is sent. Note If you want to trigger an alert each time a task encounters an error, set the trigger condition to Error. | |
Instance Generated | This trigger condition is available only when the object type is Workspace. | |
Fluctuation of Instance Count | This trigger condition is available only when the object type is Workspace. DataWorks generates scheduled instances for the next day before 24:00 every day. You receive this alert when the number of instances in the workspace fluctuates significantly compared with the historical average. | |
Exclusive Resource Group for Scheduling, Exclusive Resource Group for Data Integration | Resource Group Usage | An alert is triggered when the Usage exceeds a specified value for a specified duration. Example: An alert is triggered when Usage exceeds 50% for 15 consecutive minutes. |
Number of instances waiting for resources in resource group | An alert is triggered when Number of Instances Waiting for Resources in Resource Group exceeds a specified value for a specified duration. Example: An alert is triggered when Number of Instances Waiting for Resources in Resource Group exceeds 10 for 15 consecutive minutes. |
Configure alert actions
Alert notification method | Alert recipient | Description |
Email, SMS, phone call | Alerts can be sent to Node Owner, Shift Schedule, and Others. |
|
DingTalk ChatbotWebhook | Group members |
|
Configure alert fatigue control
Parameter | Description |
Maximum Alerts | The maximum number of alerts. No more alerts are sent after this number is reached. |
Minimum Alert Interval | The minimum time interval between two consecutive alerts. |
Alerting Do-Not-Disturb Period | After you set a do-not-disturb period, no alerts are sent during that period. For example, if the trigger conditions are set to Timeout, Error, and Incomplete, and the do-not-disturb period is set to |
After you complete the configuration, click OK to generate the rule. On the Rule Management page, you can click View Details, Enable/Disable, or Delete next to a rule to perform the corresponding operations.
View Details: Click View Details to view the basic information of the rule.
Enable or Disable: Controls the status of the rule. The rule monitors task execution only after it is enabled. You can view alert details in the Alert details panel.
Delete: Click Delete to directly delete the rule.
Modify a monitoring rule
A created rule can be modified only by the owner of the monitoring rule, a tenant administrator, or the Alibaba Cloud account.
Best practice: Send alert messages to a DingTalk group
Open the target DingTalk group to which you want to send alerts, and click the Group Settings icon in the upper-right corner.
Click Smart Group Assistant.
On the Smart Group Assistant page, click Add Robot.
On the Group Robots page, click the
icon.On the Select a Robot to Add page, click Custom.
In the Custom dialog, click Add.
In the Add Robot dialog, configure the parameters.
Parameter
Description
Robot Name
The custom name of the robot.
Add to Group
The group to which the robot is added. This value cannot be modified.
Custom Keywords
After you set custom keywords, only messages that contain the keywords can be sent. You must add DataWorks as a keyword. Note that keywords are case-sensitive.
NoteYou can set up to 10 keywords. A message must contain at least one of the keywords to be sent successfully.
Select I have read and agree to the Custom Robot Service and Disclaimer, and click Complete.
After you complete the security settings, copy the Webhook URL of the robot, and click Complete.
ImportantKeep the webhook URL secure. Exposure of the URL may pose security risks.
Go to the Rule Management page, click Create Custom Rule, set the alert notification method to DingTalk Chatbot, and paste the Webhook URL into the DingTalk Chatbot Webhook URL field.
FAQ
Q: How do I avoid frequent alert notifications?
A: You can configure alert fatigue control to set the maximum number of alerts, alert intervals, and a do-not-disturb period. For details, see Alert fatigue control.