GetAlertRule

Updated at:

Retrieves a custom monitoring alert rule.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

Id

string

No

The ID of the alert rule to query, specified as a string. You can obtain the ID from the PagingInfo.AlertRules[].Id parameter in the response of the ListAlertRules operation.

28547072

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request. You can use the ID to locate logs and troubleshoot issues.

8abcb91f-d266-4073-b907-2ed****

AlertRule

object

The details of the custom rule.

Id

integer

The ID of the custom rule.

16035

Name

string

The name of the custom rule.

error_rule

Owner

string

The Alibaba Cloud UID of the owner of the custom rule.

279961421580845157

Enabled

boolean

Indicates whether the alert rule is enabled.

true

Notification

object

The alert notification configuration.

SilenceStartTime

string

The start time of the alert silence period, in the 24-hour format HH:mm.

22:00

SilenceEndTime

string

The end time of the alert silence period, in the 24-hour format HH:mm.

23:00

IntervalInMinutes

integer

The alert interval, in minutes. Valid values: 5 to 10000.

30

Maximum

integer

The maximum number of alerts per calendar day. Valid values: 1 to 10000.

3

Channels

array

The list of alert channels.

string

The alert channel. Valid values:

  • Mail: email

  • Phone: phone call

  • Sms: text message

  • Dingding: DingTalk webhook

  • Feishu: Lark webhook

  • Weixin: WeCom webhook

  • Webhook: custom webhook

Sms

Receivers

array<object>

The alert recipients.

object

ReceiverType

string

The alert recipient type. Valid values:

  • AliUid: Alibaba Cloud UID

  • ShiftSchedule: shift schedule

  • TaskOwner: node owner, applicable to custom alerting and event alerting

  • Owner: owner, applicable to baseline alerting

  • WebhookUrl: custom webhook URL

  • DingdingUrl: DingTalk webhook URL

  • FeishuUrl: Lark webhook URL

  • WeixinUrl: WeCom webhook URL

WebhookUrl

ReceiverValues

array

The values of the alert recipients.

string

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

123123123

Extension

string

The additional configuration required for the alert recipient. If ReceiverType is set to DingdingUrl, you can set this parameter to {"atAll":true} to mention all members.

{"atAll":true}

TriggerCondition

object

The conditions that trigger the alert.

Type

string

The type of the trigger condition. Valid values:

  • Finished: the instance is completed

  • UnFinished: the instance is not completed

  • Error: an error occurs on the instance

  • CycleUnfinished: the instance cycle is not completed

  • Timeout: the instance times out

  • InstanceTransferComplete: the task-to-instance transfer is completed

  • InstanceTransferFluctuate: the number of instances fluctuates

  • ExhaustedError: an error still occurs after automatic reruns

  • InstanceKeyword: the error instance contains a keyword

  • InstanceErrorCount: the number of error instances

  • InstanceErrorPercentage: the proportion of error instances

  • ResourceGroupPercentage: the resource group utilization rate

  • ResourceGroupWaitCount: the number of instances waiting for resources in the resource group

Error

Extension

object

The extension information. This parameter is required for some trigger conditions.

Error

object

The error alert configuration.

StreamTaskIds

array

The IDs of the real-time computing tasks to monitor.

integer

The ID of the real-time computing task.

123123

AutoRerunAlertEnabled

boolean

Specifies whether to generate an alert when an offline task is automatically rerun due to a failure.

false

Timeout

object

The timeout alert configuration.

TimeoutInMinutes

integer

The timeout period, in minutes.

10

UnFinished

object

The settings for alerts when an instance has not finished.

UnFinishedTime

string

The deadline for completion, in hh:mm format. Valid values for hh: 0 to 47. Valid values for mm: 0 to 59.

12:00

CycleUnfinished

object

The settings for alerts when a cycle has not finished.

CycleAndTime

array<object>

The list of cycle and time configurations.

object

CycleId

integer

The cycle ID. Valid values: 1 to 288.

1

Time

string

The deadline for completion, in hh:mm format. Valid values for hh: 0 to 47. Valid values for mm: 0 to 59.

12:00

InstanceErrorCount

object

The instance error count alert configuration.

Count

integer

The number of error instances. Valid values: 1 to 10000.

10

InstanceErrorPercentage

object

The instance error percentage alert configuration.

Percentage

integer

The percentage of error instances. Valid values: 1 to 100.

10

InstanceTransferFluctuate

object

The task-to-instance transfer fluctuation alert configuration.

Trend

string

The fluctuation type of the task-to-instance transfer. Valid values:

  • abs: absolute value

  • increase: increase

  • decrease: decrease

10

Percentage

integer

The fluctuation percentage of the task-to-instance transfer. Valid values: 1 to 100.

10

Target

object

The monitored object.

Type

string

The monitored object type. Valid values:

  • Task: node

  • Baseline: baseline

  • Project: workspace

  • BizProcess: business flow

Task

Ids

array

The list of monitored object IDs.

integer

The ID of the monitored object.

32570

AllowTasks

array

The whitelist of monitored tasks.

integer

The ID of the task in the whitelist.

123123

Examples

Success response

JSON format

{
  "RequestId": "8abcb91f-d266-4073-b907-2ed****",
  "AlertRule": {
    "Id": 16035,
    "Name": "error_rule",
    "Owner": "279961421580845157",
    "Enabled": true,
    "Notification": {
      "SilenceStartTime": "22:00",
      "SilenceEndTime": "23:00",
      "IntervalInMinutes": 30,
      "Maximum": 3,
      "Channels": [
        "Sms"
      ],
      "Receivers": [
        {
          "ReceiverType": "WebhookUrl",
          "ReceiverValues": [
            "123123123"
          ],
          "Extension": "{\"atAll\":true}"
        }
      ]
    },
    "TriggerCondition": {
      "Type": "Error",
      "Extension": {
        "Error": {
          "StreamTaskIds": [
            123123
          ],
          "AutoRerunAlertEnabled": false
        },
        "Timeout": {
          "TimeoutInMinutes": 10
        },
        "UnFinished": {
          "UnFinishedTime": "12:00"
        },
        "CycleUnfinished": {
          "CycleAndTime": [
            {
              "CycleId": 1,
              "Time": "12:00"
            }
          ]
        },
        "InstanceErrorCount": {
          "Count": 10
        },
        "InstanceErrorPercentage": {
          "Percentage": 10
        },
        "InstanceTransferFluctuate": {
          "Trend": "10",
          "Percentage": 10
        }
      },
      "Target": {
        "Type": "Task",
        "Ids": [
          32570
        ],
        "AllowTasks": [
          123123
        ]
      }
    }
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.