All Products
Search
Document Center

Application Real-Time Monitoring Service:CreateOrUpdateAlertRule

Last Updated:May 09, 2024

Creates or modifies an alert rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
arms:CreateAlertRulesWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
AlertIdlongNo

The ID of the alert rule.

  • If you do not specify this parameter, a new alert rule is created.
  • If you specify this parameter, the specified alert rule is modified.
546xxx
AlertNamestringYes

The name of the alert rule.

Alert Rule Demo
RegionIdstringYes

The region ID.

cn-hangzhou
AlertTypestringYes

The type of the alert rule. Valid values:

  • APPLICATION_MONITORING_ALERT_RULE: alert rule for Application Monitoring
  • BROWSER_MONITORING_ALERT_RULE: alert rule for Browser Monitoring
  • PROMETHEUS_MONITORING_ALERT_RULE: alert rule for Prometheus Service

Valid values:

  • PROMETHEUS_MONITORING_ALERT_RULE
  • APPLICATION_MONITORING_ALERT_RULE
  • BROWSER_MONITORING_ALERT_RULE
  • prometheus monitoring alert
  • application monitoring alert
  • browser monitoring alert
APPLICATION_MONITORING_ALERT_RULE
AlertStatusstringNo

The status of the alert rule. Valid values:

  • RUNNING (default)
  • STOPPED
RUNNING
NotifyStrategystringNo

The notification policy.

  • If you set this parameter to null, no notification policy is specified. After you create an alert rule, you can create a notification policy and specify match rules and match conditions. For example, you can specify the name of the alert rule as the match condition. When the alert rule is triggered, an alert event is generated and an alert notification is sent to the contacts or contact groups that are specified in the notification policy.
  • To specify a notification policy, set this parameter to the ID of the notification policy. Application Real-Time Monitoring Service (ARMS) automatically adds a match rule to the notification policy and specifies the ID of the alert rule as the match condition. The name of the alert rule is also displayed. This way, the alert events that are generated based on the alert rule can be matched by the specified notification policy.
569xxx
PidsstringNo

The process ID (PID) that is associated with the Application Monitoring or Browser Monitoring alert rule.

["b590lhguqs@40d8deedfa9******"]
AutoAddNewApplicationbooleanNo

Specifies whether to apply the alert rule to new applications that are created in Application Monitoring or Browser Monitoring. Valid values:

  • true: enables the health check feature.
  • false: disables the automatic backup feature.
false
MetricsTypestringNo

The metric type of the Application Monitoring or Browser Monitoring alert rule. For more information, see the following table.

jvm
FiltersstringNo

The filter conditions of the Application Monitoring or Browser Monitoring alert rule. The following code shows the format of matching rules:

"DimFilters": [ 
{ 
 "FilterOpt": "ALL",
 "FilterValues": [],         // The value of the filter condition. 
 "FilterKey": "rootIp"     // The key of the filter condition. 
}
]

Valid values of FilterOpt:

  • STATIC: matches the value of the specified dimension.
  • ALL: matches the values of all dimensions.
  • DISABLE: aggregates the values of all dimensions.
{"DimFilters": [ { "FilterOpt": "ALL", "FilterValues": [], "FilterKey": "rootIp" } ] }
AlertRuleContentstringNo

The content of the Application Monitoring or Browser Monitoring alert rule. The following code provides an example of the AlertRuleContent parameter. For more information about the meaning of each field, see the supplementary description.

{ 
    "Condition": "OR", 
     "AlertRuleItems": [ 
             { "Operator": "CURRENT_LTE",
                 "MetricKey": "appstat.jvm.threadcount", 
                 "Value": 1000, 
                 "Aggregate": "AVG",
                  "N": 1
            } 
       ]  
  }
Note The conditional fields vary depending on the values of the MetricsType and AlertRuleItems.MetricKey parameters. For more information about the types of metrics supported by Application Monitoring and Browser Monitoring and the alert rule fields corresponding to each metric, see the supplementary description.
{ "Condition": "OR", "AlertRuleItems": [ { "Operator": "CURRENT_LTE", "MetricKey": "appstat.jvm.threadcount", "Value": 1000, "Aggregate": "AVG", "N": 1 } ] }
AlertCheckTypestringNo

The alert check type of the Prometheus alert rule. Valid values:

  • STATIC: a static threshold value. If you set the parameter to STATIC, you must specify the MetricsKey parameter. For more information, see the Correspondence between AlertGroup and MetricsKey for Prometheus Service table.
  • CUSTOM: a custom PromQL statement. If you set the parameter to CUSTOM, you must specify the PromQL, Duration, and Message parameters to create a Prometheus alert rule.
STATIC
ClusterIdstringNo

The ID of the monitored cluster.

ceba9b9ea5b924dd0b6726d2de6******
AlertGrouplongNo

The alert contact group ID of the Prometheus alert rule. Valid values:

  • -1: custom PromQL
  • 1: Kubernetes load
  • 15: Kubernetes node
-1
PromQLstringNo

The PromQL statement of the Prometheus alert rule.

node_memory_MemAvailable_bytes{} / node_memory_MemTotal_bytes{} * 100
DurationlongNo

The duration of the Prometheus alert rule. Unit: minutes.

1
LevelstringNo

The severity level of the Prometheus alert rule.

  • P1: Alert notifications are sent for major issues that affect the availability of core business, have a huge impact, and may lead to serious consequences.
  • P2: Alert notifications are sent for service errors that affect the system availability with relatively limited impact.
  • P3: Alert notifications are sent for issues that may cause service errors or negative effects, or alert notifications for services that are relatively less important.
  • P4: Alert notifications are sent for low-priority issues that do not affect your business.
  • Default: Alert notifications are sent regardless of alert levels.
P2
MessagestringNo

The alert message of the Prometheus alert rule.

Namespace: {{$labels.namespace}} / Pod: {{$labels.pod_name}} / Container: {{$labels.container}} Memory usage exceeds 80%. Current value: {{ printf \\\\\"%.2f\\\\\" $value }}%
LabelsstringNo

The tags of the Prometheus alert rule.

[ { "Value": "cms_polardb", "Name": "_aliyun_cloud_product" } ]
AnnotationsstringNo

The annotations of the Prometheus alert rule.

\[ { "Value": "PolarDB slow queries", "Name": "\_aliyun_display_name" }
MetricsKeystringNo

The alert metrics. If you set the AlertCheckType parameter to STATIC when you create a Prometheus alert rule, you must specify the MetricsKey parameter.

Note Alert metrics vary depending on the value of the AlertGroup parameter. For more information about the correspondence between AlertGroup and MetricsKey, see the supplementary description.
pop.status.error
Tagsobject []No

The list of tags.

KeystringNo

The tag key.

owner
ValuestringNo

The tag value.

John
MarkTagsobject []No

Application Tags. Used for application monitoring alert rules, to filter applications associated with alert rules.

KeystringNo

The Tag Key.

service
ValuestringNo

The Tag Value.

proudct
DataConfigstringNo

Data Configuration. The dataRevision field specifies the data repair method when there is no data for the metric.

  • Fill with zero: 0
  • Fill with one: 1
  • Fill with null: 2 (default, does not trigger an alarm)
{ "dataRevision": 2 }
NoticestringNo

Effective Time and Notification Time. Used for compatibility with legacy rules.

AlertPiplinesstringNo

Alarm Notification Channel Configuration. Used for compatibility with legacy rules.

NotifyModestringNo

Notification Mode. Normal mode or Simplified mode.

Enumeration Value:
  • DIRECTED_MODE
  • NORMAL_MODE
NORMAL_MODE

Description of the AlertRuleContent parameter

{ 
    "Condition": "OR",
     "AlertRuleItems": [
             { "Operator": "CURRENT_LTE",
                 "MetricKey": "appstat.jvm.threadcount",
                 "Value": 1000,
                 "Aggregate": "AVG",
                  "N": 1
            } 
       ]  
  }
  • Condition: the relationship between multiple alert conditions.
    • OR: meets any of the specified conditions.
    • AND: meets all the specified conditions.
  • Operator: the comparison operator that is used to compare the metric value with the threshold.
    • CURRENT_GTE: greater than or equal to
    • CURRENT_LTE: less than or equal to
    • PREVIOUS_UP: the increase percentage compared with the last period
    • PREVIOUS_DOWN: the decrease percentage compared with the last period
    • HOH_UP: the increase percentage compared with the last hour
    • HOH_DOWN: the decrease percentage compared with the last hour
    • DOD_UP: the increase percentage compared with the last day
    • DOD_DOWN: the decrease percentage compared with the last day
  • MetricKey: the metric of the alert condition. Valid values of the MetricKey parameter vary depending on the value of the MetricsType parameter. For more information about the correspondence between the two parameters, see the following tables.
  • Value: the threshold of the alert condition.
  • Aggregate: the aggregation method of the alert condition.
    • AVG: calculates the average value
    • SUM: calculates the total value
    • MAX: selects the maximum value
    • MIN: selects the minimum value
    • CONTINUOUS: selects the continuous value
    • AVG_WEIGHTED: calculates the weighted value of the average error rate
  • N: last N minutes.

Correspondence between MetricsType and AlertRuleContent.AlertRuleItems.MetricKey for Application Monitoring

MetricsTypeMetric typeAlertRuleContent.AlertRuleItems.MetricKey
jvmJVM monitoring- appstat.jvm.gc.oldgccountinstant: the number of full heap garbage collections (Full GCs) in JVM- appstat.jvm.gc.oldgctimeinstant: the amount of time that is consumed by Full GCs in JVM- appstat.jvm.gc.younggccountinstant: the number of GCs in the young generation- appstat.jvm.gc.younggctimeinstant: the amount of time that is consumed by GCs in the young generation- appstat.jvm.heap_total: the total memory space in the JVM heap- appstat.jvm.heap_used: the used space of the JVM heap memory- appstat.jvm.non_heap_committed: the submitted space of the non-heap JVM memory- appstat.jvm.non_heap_init: the initial space of the non-heap JVM memory- appstat.jvm.non_heap_max: the maximum space of the non-heap JVM memory- appstat.jvm.non_heap_used: the used space of the non-heap JVM memory- appstat.jvm.threadblockedcount: the number of blocked JVM threads- appstat.jvm.threadcount: the total number of JVM threads- appstat.jvm.threaddeadlockcount: the number of deadlocked JVM threads- appstat.jvm.threadnewcount: the number of new JVM threads- appstat.jvm.threadrunnablecount: the number of runnable JVM threads- appstat.jvm.threadterminatedcount: the number of terminated JVM threads- appstat.jvm.threadtimedwaitcount: the number of timed-out JVM threads- appstat.jvm.threadwaitcount: the number of waiting JVM threads
saehostSAE host monitoring- appstat.infra.sae.systemcpu: the CPU utilization- appstat.infra.sae.systemdiskiopsread: the disk IOPS read- appstat.infra.sae.systemdiskiopswrite: the disk IOPS write- appstat.infra.sae.systemdiskrate: the disk usage- appstat.infra.sae.systemdiskread: the read I/O throughput of the disk- appstat.infra.sae.systemdisktotal: the total number of disks- appstat.infra.sae.systemdiskused: the number of disks in use- appstat.infra.sae.systemdiskwrite: the write I/O throughput of the disk- appstat.infra.sae.systemload: the system load- appstat.infra.sae.systemmemrate: the memory usage- appstat.infra.sae.systemmemtotal: the total memory- appstat.infra.sae.systemmemused: the used memory- appstat.infra.sae.systemnetrecv: the received bytes- appstat.infra.sae.systemnetrecvdrop: the packet loss of received data- appstat.infra.sae.systemnetrecverror: the received error packets- appstat.infra.sae.systemnetrecvpacket: the received packets- appstat.infra.sae.systemnettran: the sent bytes- appstat.infra.sae.systemnettrandrop: the packet loss of sent data- appstat.infra.sae.systemnettranerror: the sent error packets- appstat.infra.sae.systemnettranpacket: the sent packets
txn_dbSQL metrics- appstat.sql.count: the number of database calls- appstat.sql.error: the number of database call errors- appstat.sql.rt: the response time of database calls
dbDatabase metrics- appstat.database.count: the number of database calls- appstat.database.errcount: the number of database call errors- appstat.database.rt: the response time of database calls
threadpoolThread pool monitoring- appstat.threadpool.threadcorepoolsize: the number of core threads- appstat.threadpool.threadmaxpoolsize: the maximum number of threads- appstat.threadpool.threadpoolactivecount: the number of active threads- appstat.threadpool.threadpoolqueuesize: the queue size- appstat.threadpool.threadpoolsize: the current number of threads- appstat.threadpool.threadpooltaskcount: the number of executed tasks- appstat.threadpool.threadpoolusedpercent: the thread pool usage
exceptionAbnormal API calls- appstat.exception.count: the number of abnormal API calls for the application- appstat.exception.rt: the response time of abnormal API calls for the application
txn_typeApplication dependent services-appstat.outcall.count: the number of application-dependent service calls- appstat.outcall.errorrate: the error rate of application-dependent service calls- appstat.outcall.rt: the response time of application-dependent service calls
txnApplication-provided services- appstat.transaction.count: the number of API calls- appstat.transaction.error: the number of API call errors- appstat.transaction.errorrate: the error rate of API calls- appstat.transaction.rt: the response time of API calls
hostHost monitoring- appstat.jvm.systemcpuusage: the CPU utilization of the host- appstat.jvm.systemcpuuser: the CPU occupancy rate of the host in user mode- appstat.jvm.systemdiskfree: the idle disk space of the host- appstat.jvm.systemdiskusage: the disk usage of the host- appstat.jvm.systemload: the system load of the host- appstat.jvm.systemmemfree: the idle memory space of the host- appstat.jvm.systemmemusage: the memory usage of the host- appstat.jvm.systemnetinerrs: the number of error packets that is received by the host- appstat.jvm.systemnetouterrs: the number of error packets that is sent by the host
schedulerScheduled tasks-appstat.scheduler.rt: uptime- appstat.scheduler.count: the number of times that the task runs- appstat.scheduler.error: the number running errors- appstat.scheduler.delay: the time delay of scheduling

Correspondence between MetricsType and AlertRuleContent.AlertRuleItems.MetricKey for Browser Monitoring

MetricsTypeMetric typeAlertRuleContent.AlertRuleItems.MetricKey
apiAPI metrics- webstat.api.detail.count: the number of API requests- webstat.api.detail.fail_time: the amount of time consumed by failed API requests- webstat.api.detail.fail_uv: the number of users affected by failed API requests- webstat.api.detail.success_rate: the success rate of API requests- webstat.api.detail.success_time: the amount of time consumed by successul API requests
page.apiPage API metrics- webstat.api.detail.page_api.count: the number of API requests- webstat.api.detail.page_api.fail_time: the amount of time consumed by failed API requests- webstat.api.detail.page_api.success_rate: the success rate of API requests- webstat.api.detail.page_api.success_time: the amount of time consumed by successul API requests
pagePage metrics- webstat.api.detail.page_api.fail_uv: the number of users affected by failed API requests- webstat.index.pv: the number of page views (PVs)- webstat.jserror.count: the number of JS errors- webstat.jserror.rate: the JS error rate- webstat.msg.top.error_uv: the number of users affected by JS errors- webstat.resource.sum: the number of resource errors- webstat.satisfy.satisfy: the page satisfaction- webstat.speed.avg_cfpt: the custom first paint time (FPT) of the page- webstat.speed.avg_ctti: the custom time to interact (TTI) of the page- webstat.speed.avg_dns: the DNS query time of the page- webstat.speed.avg_dom: the DOM parsing time of the page- webstat.speed.avg_fmp: the first meaningful paint (FMP) of the page- webstat.speed.avg_fpt: the FPT of the page- webstat.speed.avg_load: the amount of time consumed to completely load the page- webstat.speed.avg_ready: the ready time- webstat.speed.avg_res: the amount of time consumed to load resources- webstat.speed.avg_ssl: the amount of time consumed to establish a Secure Sockets Layer (SSL) connection- webstat.speed.avg_t1: the custom t1 time of the page- webstat.speed.avg_t10: the custom t10 time of the page- webstat.speed.avg_t2: the custom t2 time of the page- webstat.speed.avg_t3: the custom t3 time of the page- webstat.speed.avg_t4: the custom t4 time of the page- webstat.speed.avg_t5: the custom t5 time of the page- webstat.speed.avg_t6: the custom t6 time of the page- webstat.speed.avg_t7: the custom t7 time of the page- webstat.speed.avg_t8: the custom t8 time of the page- webstat.speed.avg_t9: the custom t9 time of the page- webstat.speed.avg_tcp: the amount of time consumed to establish a Transmission Control Protocol (TCP) connection- webstat.speed.avg_trans: the amount of time consumed to transfer the content of the page- webstat.speed.avg_ttfb: the response time of network requests- webstat.speed.avg_tti: the TTI of the page
customCustom metrics- webstat.avg.avg_val: the average value of reported data- webstat.sum.sum_val: the sum of reported data

Correspondence between AlertGroup and MetricsKey for Prometheus Service

AlertGroupAlert contact groupMetricsKey
1Kubernetes load- prom.workload.container_cpu_usage: the CPU utilization of the container- prom.workload.job_execute_error: job failure- prom.workload.pod_cpu_usage: the disk usage of the pod- prom.workload.pod_start_timeout: startup timeout failure of the pod- prom.workload.pod_restart_frequent: frequent restart of the pod- prom.workload.pod_status_error: abnormal pod status- prom.workload.container_memory_usage: the memory usage of the container- prom.workload.deployment_pod_survival: the availability rate of the Deployment pod
15Kubernetes node- prom.node.node_memory_usage: the memory usage of the node- prom.node.node_cpu_usage: the CPU utilization of the node- prom.node.node_disk_usage: the disk usage of the node- prom.node.node_status_error: abnormal node status

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

RequestIdstring

The request ID.

337B8F7E-0A64-5768-9225-E9B3CF******
AlertRuleobject

The details of the alert rule.

AlertIdfloat

The ID of the alert rule.

5510445
AlertNamestring

The name of the alert rule.

arms-test
UserIdstring

The ID of the Alibaba Cloud account.

1131971649******
RegionIdstring

The region ID.

cn-hangzhou
AlertTypestring

The type of the alert rule. Valid values:

  • APPLICATION_MONITORING_ALERT_RULE: alert rule for Application Monitoring
  • BROWSER_MONITORING_ALERT_RULE: alert rule for Browser Monitoring
  • PROMETHEUS_MONITORING_ALERT_RULE: alert rule for Prometheus Service
APPLICATION_MONITORING_ALERT_RULE
AlertStatusstring

The status of the alert rule. Valid values:

  • RUNNING
  • STOPPED
  • PAUSED
Note The PAUSED status indicates that the alert rule is abnormal and is actively paused by the system. The alert rule may be paused because that it is not unique or the associated cluster has been deleted.
RUNNING
CreatedTimelong

The timestamp generated when the alert rule was created. Unit: seconds.

1641438611000
UpdatedTimelong

The timestamp generated when the alert rule was updated. Unit: seconds.

1641438611000
Extendstring

The extended fields.

{\\"alarmContext\\":\\"{\\\\\"content\\\\\":\\\\Alert name: $Alert name\\\\\\nFilter condition: $Filter condition\\\\\\nAlert time: $Alert time\\\\\\nAlert content: $Alert content\\\\\\nNote: The alert persists before you receive an email that reminds you to clear the alert. You will be reminded of the alert again 24 hours later. \\\\\",\\\\\"subTitle\\\\\":\\\\\"\\\\\"}\\",\\"alertWays\\":\\"\[0,1]\\",\\"contactGroupIds\\":\\"381,5075\\",\\"notice\\":\\"{\\\\\"endTime\\\\\":1480607940000,\\\\\"noticeEndTime\\\\\":1480607940000,\\\\\"noticeStartTime\\\\\":1480521600000,\\\\\"startTime\\\\\":1480521600000}\\"}
NotifyStrategystring

The name of the notification policy.

ALERT_MANAGER
Pidsarray

The process ID (PID) that was associated with the Application Monitoring or Browser Monitoring alert rule.

string

The PID of the application.

b590lhguqs@40d8deedfa9******
AutoAddNewApplicationboolean

Indicates whether the alert rule was applied to new applications that were created in Application Monitoring or Browser Monitoring. Valid values:

  • true: enables the health check feature.
  • false: disables the automatic backup feature.
false
MetricsTypestring

The metric type of the Application Monitoring or Browser Monitoring alert rule.

JVM
AlertRuleContentobject

The content of the Application Monitoring or Browser Monitoring alert rule.

Conditionstring

The relationship between multiple alert conditions that were specified for the Application Monitoring or Browser Monitoring alert rule. Valid values:

  • OR: meets any of the specified conditions.
  • AND: meets all the specified conditions.
"|"
AlertRuleItemsobject []

The trigger conditions of the Application Monitoring or Browser Monitoring alert rule.

Nfloat

Indicates the last N minutes.

1
MetricKeystring

The metric of the alert condition.

appstat.jvm.non_heap_used
Aggregatestring

The aggregation method of the alert condition. Valid values:

  • AVG: calculates the average value
  • SUM: calculates the total value
  • MAX: selects the maximum value
  • MIN: selects the minimum value
AVG
Operatorstring

The comparison operator that was used to compare the metric value with the threshold. Valid values:

  • CURRENT_GTE: greater than or equal to
  • CURRENT_LTE: less than or equal to
  • PREVIOUS_UP: the increase percentage compared with the last period
  • PREVIOUS_DOWN: the decrease percentage compared with the last period
  • HOH_UP: the increase percentage compared with the last hour
  • HOH_DOWN: the decrease percentage compared with the last hour
  • DOD_UP: the increase percentage compared with the last day
  • DOD_DOWN: the decrease percentage compared with the last day
CURRENT_GTE
Valuestring

The threshold of the alert condition.

1
Filtersobject

The filter conditions of the Application Monitoring or Browser Monitoring alert rule.

DimFiltersobject []

The information about each filter condition of the Application Monitoring or Browser Monitoring alert rule.

FilterKeystring

The key of the filter condition.

rootIp
FilterOptstring

The logical operator of the filter condition.

ALL
FilterValuesarray

The details of the filter condition.

string

The value of the filter condition.

[]
CustomSLSFiltersobject []

The custom filter condition of the Browser Monitoring alert rule.

Keystring

The key of the filter condition.

username
Optstring

The logical operator of the filter condition. Valid values:

  • =: equal to
  • not: not equal to
=
Valuestring

The value of the filter condition.

test
Tstring

The log type of Browser Monitoring. This field was not included in other filter conditions.

null
Showboolean

Indicates whether this filter condition was displayed on the frontend.

false
CustomSLSGroupByDimensionsarray

The information of the aggregation dimension.

string

The value of the aggregation dimension.

["page"]
CustomSLSWheresarray

The details of the custom filter condition.

string

The value of the custom filter condition.

["t like '%api%'"]
AlertCheckTypestring

The alert check type of the Prometheus alert rule. Valid values:

  • STATIC: a static threshold value.
  • CUSTOM: a custom PromQL statement.
STATIC
ClusterIdstring

The ID of the monitored cluster.

ceba9b9ea5b924dd0b6726d2de6******
AlertGrouplong

The alert contact group ID of the Prometheus alert rule. Valid values:

  • -1: custom PromQL
  • 1: Kubernetes load
  • 15: Kubernetes node
-1
PromQLstring

The PromQL statement of the Prometheus alert rule.

node_memory_MemAvailable_bytes{} / node_memory_MemTotal_bytes{} * 100
Durationstring

The duration of the Prometheus alert rule. Unit: minutes.

1
Levelstring

The severity level of the Prometheus alert rule.

  • P1: Alert notifications are sent for major issues that affect the availability of core business, have a huge impact, and may lead to serious consequences.
  • P2: Alert notifications are sent for service errors that affect the system availability with relatively limited impact.
  • P3: Alert notifications are sent for issues that may cause service errors or negative effects, or alert notifications for services that are relatively less important.
  • P4: Alert notifications are sent for low-priority issues that do not affect your business.
  • Default: Alert notifications are sent regardless of alert levels.
P2
Messagestring

The alert message of the Prometheus alert rule.

Namespace: {{$labels.namespace}} / Pod: {{$labels.pod_name}} / Container: {{$labels.container}} Memory usage exceeds 80%. Current value: {{ printf \\\\\"%.2f\\\\\" $value }}%
Labelsobject []

The tags of the Prometheus alert rule.

Namestring

The tag key.

123
Valuestring

The tag value.

abc
Annotationsobject []

The annotations of the Prometheus alert rule.

Namestring

The key of the annotation.

123
Valuestring

The value of the annotation.

abc
Tagsobject []

The list of tags.

Keystring

The tag key.

owner
Valuestring

The tag value.

John
NotifyModestring

Notification Mode.

NORMAL_MODE

Examples

Sample success responses

JSONformat

{
  "RequestId": "337B8F7E-0A64-5768-9225-E9B3CF******",
  "AlertRule": {
    "AlertId": 5510445,
    "AlertName": "arms-test",
    "UserId": "1131971649******",
    "RegionId": "cn-hangzhou",
    "AlertType": "APPLICATION_MONITORING_ALERT_RULE",
    "AlertStatus": "RUNNING",
    "CreatedTime": 1641438611000,
    "UpdatedTime": 1641438611000,
    "Extend": "{\\\\\"alarmContext\\\\\":\\\\\"{\\\\\\\\\\\"content\\\\\\\\\\\":\\\\\\\\Alert name: $Alert name\\\\\\\\\\\\nFilter condition: $Filter condition\\\\\\\\\\\\nAlert time: $Alert time\\\\\\\\\\\\nAlert content: $Alert content\\\\\\\\\\\\nNote: The alert persists before you receive an email that reminds you to clear the alert. You will be reminded of the alert again 24 hours later. \\\\\\\\\\\",\\\\\\\\\\\"subTitle\\\\\\\\\\\":\\\\\\\\\\\"\\\\\\\\\\\"}\\\\\",\\\\\"alertWays\\\\\":\\\\\"\\[0,1]\\\\\",\\\\\"contactGroupIds\\\\\":\\\\\"381,5075\\\\\",\\\\\"notice\\\\\":\\\\\"{\\\\\\\\\\\"endTime\\\\\\\\\\\":1480607940000,\\\\\\\\\\\"noticeEndTime\\\\\\\\\\\":1480607940000,\\\\\\\\\\\"noticeStartTime\\\\\\\\\\\":1480521600000,\\\\\\\\\\\"startTime\\\\\\\\\\\":1480521600000}\\\\\"}\n",
    "NotifyStrategy": "ALERT_MANAGER",
    "Pids": [
      "b590lhguqs@40d8deedfa9******"
    ],
    "AutoAddNewApplication": false,
    "MetricsType": "JVM",
    "AlertRuleContent": {
      "Condition": "\"|\"",
      "AlertRuleItems": [
        {
          "N": 1,
          "MetricKey": "appstat.jvm.non_heap_used\n",
          "Aggregate": "AVG",
          "Operator": "CURRENT_GTE",
          "Value": "1"
        }
      ]
    },
    "Filters": {
      "DimFilters": [
        {
          "FilterKey": "rootIp",
          "FilterOpt": "ALL",
          "FilterValues": [
            "[]"
          ]
        }
      ],
      "CustomSLSFilters": [
        {
          "Key": "username",
          "Opt": "=",
          "Value": "test",
          "T": "null",
          "Show": false
        }
      ],
      "CustomSLSGroupByDimensions": [
        "[\"page\"]"
      ],
      "CustomSLSWheres": [
        "[\"t like '%api%'\"]"
      ]
    },
    "AlertCheckType": "STATIC",
    "ClusterId": "ceba9b9ea5b924dd0b6726d2de6******",
    "AlertGroup": -1,
    "PromQL": "node_memory_MemAvailable_bytes{} / node_memory_MemTotal_bytes{} * 100",
    "Duration": "1",
    "Level": "P2",
    "Message": "Namespace: {{$labels.namespace}} / Pod: {{$labels.pod_name}} / Container: {{$labels.container}} Memory usage exceeds 80%. Current value: {{ printf \\\\\\\\\\\"%.2f\\\\\\\\\\\" $value }}%\n",
    "Labels": [
      {
        "Name": "123",
        "Value": "abc"
      }
    ],
    "Annotations": [
      {
        "Name": "123",
        "Value": "abc"
      }
    ],
    "Tags": [
      {
        "Key": "owner",
        "Value": "John"
      }
    ],
    "NotifyMode": "NORMAL_MODE"
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-05-07The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: AutoAddTargetConfig
2024-04-29The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Product
2023-12-18The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.
2023-10-20The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.
2023-10-17The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.
2023-10-16The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: NotifyMode
2023-10-11The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.
2023-09-14The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: DataConfig
    Added Input Parameters: Notice
    Added Input Parameters: AlertPiplines
2023-08-24The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: MarkTags
2023-05-11The request parameters of the API has changed. The response structure of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Tags
Output ParametersThe response structure of the API has changed.