All Products
Search
Document Center

DataWorks:CreateAlertRule

Last Updated:Dec 05, 2024

Creates a custom monitoring alert rule.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
NamestringYes

The name of the rule.

xm_create_test
OwnerstringYes

The ID of the Alibaba Cloud account used by the creator of the rule.

279114181716147735
EnabledbooleanYes

Indicates whether the rule is enabled.

true
TriggerConditionobjectYes

The conditions for triggering the alert.

TypestringNo

The condition for triggering the alert. Valid values:

  • Finished: The system sends an alert notification when the instance is successfully run.
  • UnFinished: The system sends an alert notification if the instance is still running at a specified point in time.
  • Error: The system sends an alert notification if an error occurs when the instance is running.
  • CycleUnfinished: The system sends an alert notification if the instance is still running at the end of a specified cycle.
  • Timeout: The system sends an alert notification if the instance is still running after a specified period of time ends.
  • InstanceTransferComplete: The system sends an alert notification if DataWorks generates auto triggered node instances that need to run the next day before 24:00.
  • InstanceTransferFluctuate: The system sends an alert notification when the number of auto triggered node instances that are generated in your workspace significantly fluctuates, in comparison with the average number of auto triggered node instances that are historically generated in the workspace.
  • ExhaustedError: The system sends an alert notification if an error persists after the instance is automatically rerun.
  • InstanceKeyword: The system sends an alert notification if the instance with errors contain specified keywords.
  • InstanceErrorCount: The system sends an alert notification if the number of instances on which an error occurs on the current day reaches a specified threshold.
  • InstanceErrorPercentage: The system sends an alert notification if the proportion of the number of instances on which an error occurs in the workspace to the total number of instances on the current day reaches a specified threshold.
  • ResourceGroupPercentage: The system sends an alert notification if the value of the ResourceGroupPercentage parameter is greater than a specific percentage for a specific period of time.
  • ResourceGroupWaitCount: The system sends an alert notification if the value of the ResourceGroupWaitCount parameter is greater than a specific number for a specific period of time.
Error
ExtensionobjectNo

The extended information about the rule. This parameter is required for some trigger conditions.

ErrorobjectNo

The alert configuration. This parameter takes effect only if the Type parameter is set to Error.

StreamTaskIdsarrayNo

The IDs of the real-time computing tasks. This parameter is required when you monitor real-time computing tasks.

longNo

The ID of the real-time computing task.

123
AutoRerunAlertbooleanNo

Indicates whether an alert is triggered if a batch synchronization task is rerun after it fails to run as expected.

false
TimeoutobjectNo

The alert configuration. This parameter takes effect only if the Type parameter is set to Timeout.

TimeoutInMinutesintegerNo

The timeout period. Unit: minutes. Valid values: 1 to 21,600.

10
UnFinishedobjectNo

The alert configuration. This parameter takes effect only if the Type parameter is set to UnFinished.

UnFinishedTimestringNo

The timeout period of the instance that is still running at a specified point in time. The time is in the hh:mm format. Valid values of hh: 0 to 47. Valid values of mm: 0 to 59.

30:00
CycleUnfinishedobjectNo

The alert configuration. This parameter takes effect only if the Type parameter is set to CycleUnfinished.

CycleAndTimearray<object>No

The configurations of the scheduling cycle and timeout period of the instance.

objectNo
CycleIdintegerNo

The ID of the scheduling cycle of the instance. Valid values: 1 to 288.

1
TimestringNo

The timeout period of instance running. The time is in the hh:mm format. Valid values of hh: 0 to 47. Valid values of mm: 0 to 59.

12:00
InstanceErrorCountobjectNo

The alert configuration. This parameter takes effect only if the Type parameter is set to InstanceErrorCount.

CountintegerNo

The number of instances on which an error occurs. Valid values: 1 to 10,000.

5
InstanceErrorPercentageobjectNo

The alert configuration. This parameter takes effect only if the Type parameter is set to InstanceErrorPercentage.

PercentageintegerNo

The percentage of the number of instances on which an error occurs in the workspace to the total number of instances on the current day. Valid values: 1 to 100.

5
InstanceTransferFluctuateobjectNo

The alert configuration. This parameter takes effect only if the Type parameter is set to InstanceTransferFluctuate.

TrendstringNo

The way in which the number of auto triggered node instances that are generated in your workspace significantly fluctuates. Valid values:

  • abs: The number of instances increases or decreases.
  • increase: The number of instances increases.
  • decrease: The number of instances decreases.
abs
PercentageintegerNo

The percentage of fluctuation in the number of auto triggered node instances that are generated in your workspace. Valid values: 1 to 100.

10
TargetobjectNo

The monitored object.

TypestringNo

The type of the monitored object. Valid values:

  • Task: node
  • Baseline: baseline
  • Project: workspace
  • BizProcess: workflow
Task
IdsarrayNo

The IDs of monitored objects.

longNo

The ID of the monitored object.

123123
AllowTasksarrayNo

The whitelists of the monitoring tasks.

longNo

The ID of the whitelist of the monitoring task.

123
NotificationobjectNo

The configuration for the alert notification.

SilenceStartTimestringNo

The beginning of the time range for silence. The time is in the HH:mm:ss format.

00:00:00
SilenceEndTimestringNo

The end of the time range for silence. The time is in the HH:mm:ss format.

00:00:00
IntervalInMinutesintegerNo

The interval at which an alert notification is sent. Unit: minutes. Valid values: 5 to 10,000.

30
MaximumintegerNo

The maximum number of times an alert notification is sent within one calendar day. Valid values: 1 to 10,000.

3
ChannelsarrayYes

The alert channels.

stringNo

The alert channel. Valid values:

  • Mail
  • Phone
  • Sms
  • Dingding
  • Feishu
  • Weixin: WeCom notification
  • Webhook
Sms
Receiversarray<object>Yes

The alert recipient.

objectNo
ReceiverTypestringNo

The type of the alert recipient. Valid valves:

  • AliUid: Alibaba Cloud account ID.
  • Shift Schedules: The personnel in a shift schedule.
  • TaskOwner: The node owner. This parameter is available for custom alerts and event alerts.
  • Owner: The baseline owner. This parameter is available for baseline alerts.
  • WebhookUrl: URL of a custom webhook.
  • DingdingUrl: DingTalk chatbot URL.
  • FeishuUrl: Lark chatbot URL.
  • WeixinUrl: WeCom chatbot URL.
TaskOwner
ReceiverValuesarrayNo

The IDs of the alert recipients.

stringNo

The ID of the alert recipient. If the ReceiverType parameter is set to AliUid, set this parameter to the Alibaba Cloud account ID. If the ReceiverType parameter is set to ShiftSchedule, set this parameter to the shift schedule ID. If the ReceiverType parameter is set to WebhookUrl, DingdingUrl, FeishuUrl, or WeixinUrl, set this parameter to the corresponding URL.

123123123
ExtensionstringNo

The additional configuration of the alert recipient. If the ReceiverType parameter is set to DingdingUrl, you can set this parameter to {"atAll":true} to remind all members in a DingTalk group.

{"atAll":true}

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

A6C6B486-E3A2-5D52-9E76-D9380485D946
Idlong

The rule ID.

123123

Examples

Sample success responses

JSONformat

{
  "RequestId": "A6C6B486-E3A2-5D52-9E76-D9380485D946\n",
  "Id": 123123
}

Error codes

For a list of error codes, visit the Service error codes.