CloudMonitor is a service that monitors Internet applications and Alibaba Cloud resources. You can connect ApsaraVideo Media Processing (MPS) to CloudMonitor to monitor transcoding jobs by configuring alert rules. This topic describes how to configure alert rules in MPS.
Configure alert rules by using CloudMonitor
Background information
The monitoring feature of MPS allows you to query the metric data about system performance and resource usage. You can also create custom alert rules to monitor service stability and analyze resource usage to detect and diagnose issues at the earliest opportunity. For more information about alert rules and how to configure alert contacts and alert contact groups, see Overview and Create an alert contact or alert contact group.
Metrics
Metric | Unit | Description | Statistical dimension | Time granularity |
RequestSuccessRate | % | The metric that describes the system availability of MPS. The metric value is calculated by using the following formula: Metric value = 1 - Server requests for which HTTP status code 5xx is returned/All requests. | User | 5 minutes |
SnapshotTasks | N/A | The number of snapshot job requests received by the MPS server. | MPS queue | 1 minute |
TranscodingDuration | Minute | The length of the output videos processed by the MPS server. | MPS queue | 1 minute |
TranscodingTasks | N/A | The number of transcoding job requests received by the MPS server. | MPS queue | 1 minute |
Procedure
Log on to the MPS console.
In the left-side navigation pane, choose
.On the MPS Queue and Callback page, click Set Alarm Rule. The Alert Rules page appears.
If you configure alert rules for an MPS queue for the first time, a service-linked role is automatically created for CloudMonitor and a message appears. Click Confirm. If you have created a service-linked role for CloudMonitor, ignore the message.
On the Alert Rules page, click Create Alert Rule.
In the Create Alert Rule panel, configure parameters. The following table describes the parameters.
Parameter
Description
Product
The service for which you want to create an alert rule. Select ApsaraVideo for Media Processing from the drop-down list.
Resource Range
The range of the resources to which the alert rule applies. Valid values:
All Resources: The alert rule applies to all resources of the specified cloud service.
Application Groups: The alert rule applies to all resources in the specified application group of the specified cloud service.
Instances: The alert rule applies to the specified resources of the specified cloud service.
Rule Description
The content of the alert rule. The parameters in this section specify the conditions that trigger an alert. To specify conditions, perform the following steps:
Click Add Rule and then select Simple Metric, Combined Metrics, Expression, or Dynamic Threshold.
In the Configure Rule Description panel, configure the rule name, metric type, metrics, threshold, alert level, and notification methods.
Click OK.
NoteFor more information about how to specify complex alert conditions, see Alert rule expressions.
Mute For
The interval at which alert notifications are sent. If the alert does not return to normal after the alert is triggered, CloudMonitor can send an alert notification again. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3 Hours, 6 Hours, 12 Hours, and 24 Hours.
If a metric value reaches the threshold, CloudMonitor sends an alert notification. If the metric value reaches the threshold again within the mute period, CloudMonitor does not resend an alert notification. If the alert is not cleared after the mute period ends, CloudMonitor resends an alert notification.
For example, if the Mute For parameter is set to 12 Hours and the alert is not cleared, CloudMonitor resends an alert notification after 12 hours.
Effective Period
The period during which the alert rule is effective. The system monitors the metrics and generates alerts only during the effective period.
Alert Contact Group
The alert contact groups to which alert notifications are sent.
The alert notifications of the application group are sent to the alert contacts that belong to the selected alert contact groups. An alert contact group can contain one or more alert contacts. For more information about how to create an alert contact and an alert contact group, see Create an alert contact or alert contact group.
Alert Callback
The callback URL that can be accessed over the Internet. CloudMonitor sends HTTP POST requests to push alert notifications to the specified URL. Only HTTP requests are supported. For more information about how to configure an alert callback, see Use the alert callback feature to send notifications about threshold-triggered alerts.
NoteYou can click Advanced Settings to configure this parameter.
To test the connectivity of an alert callback URL, perform the following steps:
Click Test next to the callback URL.
In the Webhook Test panel, you can check and troubleshoot the connectivity of the alert callback URL based on the returned status code and test result details.
NoteTo obtain the details of the test result, you can configure the Test Template Type and Language parameters and click Test.
Click Close.
Auto Scaling
If you turn on Auto Scaling, the specified scaling rule is enabled when an alert is triggered. In this case, you must configure the Region, ESS Group, and ESS Rule parameters.
For more information about how to create a scaling group, see Manage scaling groups.
For more information about how to create a scaling rule, see Manage scaling rules.
NoteYou can click Advanced Settings to configure this parameter.
Log Service
If you turn on Log Service, the alert information is written to the specified Logstore in Simple Log Service when an alert is triggered. In this case, you must configure the Region, ProjectName, and Logstore parameters.
For more information about how to create a project and a Logstore, see Getting Started.
NoteYou can click Advanced Settings to configure this parameter.
Simple Message Queue (formerly MNS) - topic
If you turn on Message Service - topic, the alert information is written to the specified topic in Simple Message Queue (formerly MNS) (SMQ) when an alert is triggered. In this case, you must configure the Region and topicName parameters.
For more information about how to create a topic, see Create a topic.
NoteYou can click Advanced Settings to configure this parameter.
Method to handle alerts when no monitoring data is found
The method that is used to handle alerts when no monitoring data is found. Default value: Do not do anything. Valid values:
Do not do anything
Send alert notifications
Treated as normal
NoteYou can click Advanced Settings to configure this parameter.
Tag
The tag of the alert rule. A tag consists of a tag key and a tag value.
Click Confirm. The alert rule is created.
Manage an alert rule
Log on to the CloudMonitor console.
In the left-side navigation pane, choose
. On the Alert Rules page, view, modify, enable, disable, or delete an alert rule based on your business requirements.