Add an alert rule based on built-in monitoring rule templates to monitor your OSS shipping task in real time and receive alert notifications through channels such as DingTalk.
Prerequisites
You have created an OSS shipping task. For more information, see Create an OSS shipping task (new version).
Step 1: Enable task run logs
Log on to the Simple Log Service console.
-
In the Project List area, click the target Project.
-
In the upper-left corner of the page, click the
icon to enable task run logs.-
If you have not enabled detailed logs for the Project, on the Service Log tab, click Enable Detailed Logs.
-
If you have enabled detailed logs for the Project, on the Service Log tab, click the
icon.
-
-
Configure the following parameters and click OK.
Parameter
Description
Job Operational Logs
After you enable Job Operational Logs, Log Service automatically creates a LogStore named internal-diagnostic_log in the specified Project. This LogStore stores the run logs and error logs for tasks such as scheduled SQL, MaxCompute shipping, OSS shipping, and data import. For more information about the log fields, see Task run logs for data transformation (new version), data import, and data shipping (new version).
Log Storage Location
After you enable task run logs, specify a Project to store the logs. The following options are available:
-
Auto Create (Recommended)
-
Current Project
-
Another Project in the same region
After you enable task run logs, you can view the run logs and error logs of your OSS shipping task in the internal-diagnostic_log LogStore within the specified Project. The log topic (__topic__) is etl_metrics. You can also query the logs for a specific task by its name. The query statement is
job_name:YourTaskName, for example,job_name:job-1646****946. -
Step 2: Configure an action policy
Log on to the Simple Log Service console.
-
Go to the Action Policy management page.
-
In the Project List area, click the target Project.
-
In the left-side navigation pane, click the
icon to go to the Alert Center page. -
Click .
-
-
Find the target action policy (sls.app.export.builtin) and click Modify.
You can also create a new action policy for alert notifications. For more information, see Action policies.
-
In the Edit Action Policy dialog box, on the Initial Action List tab, change the Request URL to the webhook URL of your DingTalk group chatbot. Keep the default settings for other options.
To get the webhook URL for a DingTalk group chatbot, see DingTalk-Custom. You can also use other notification channels based on your business needs. For more information, see Notification methods.
-
Click Confirm.
Step 3: Add an alert rule
Log Service provides five built-in monitoring rule templates. Add an alert rule that meets your business requirements. The following example uses the data shipping latency template.
Log on to the Simple Log Service console.
-
In the Project List area, click the target Project.
This is the Project where your internal-diagnostic_log LogStore is located.
-
In the left-side navigation pane, click the
icon to go to the Alert Center page. -
On the Alert Rules tab, click Create from Template.
-
In the panel that appears on the right, select the Data Shipping Latency Monitoring card and follow the on-screen instructions to complete the configuration. For more information, see Alert rule configuration.
The enabled alert rule appears in the monitoring rule list after it is added.
Related operations
After you set an alert for an OSS shipping task, you can perform the following operations.
|
Actions |
Description |
|
Disable an alert rule |
When you disable an alert rule, it no longer triggers alerts, and its Status changes to Disabled. To re-enable monitoring, no reconfiguration is required. |
|
Temporarily disable an alert rule |
After you temporarily disable an alert rule, it does not trigger alerts for a specified period. |
|
Resume an alert rule |
You can resume an alert rule that is temporarily disabled at any time. |
|
Delete an alert rule |
This operation deletes the configured parameters of the rule, such as the Alibaba Cloud account. To re-enable monitoring, you must reconfigure the parameters. |
|
Modify an alert rule |
Modify the configuration parameters of an alert rule. |