Set event notifications for vertical scaling tasks
To ensure that you can respond quickly to exceptions in vertical scaling tasks, this topic describes how to set up an alert mechanism using the Cloud Monitor service. If a vertical scaling task encounters an unexpected situation during execution, the system sends an alert. This lets you take prompt action to maintain service stability.
How it works
When a vertical scaling task from Auto Scaling runs, it automatically uses the ACS-ECS-ModifyInstanceSpec template in CloudOps Orchestration Service to modify the instance type. You can monitor the execution status of this template using Cloud Monitor and configure event notifications for it. This setup enables event notifications for vertical scaling tasks.
For more information about Cloud Monitor, see What is Cloud Monitor.
For more information about CloudOps Orchestration Service, see What is CloudOps Orchestration Service?.
Procedure
Step 1: Configure event recipients
Before you begin, determine how you want to receive anomaly alerts for scaling tasks. After you decide on a notification method, you can use one of the following methods to create your event recipients.
Notify by email, phone, or text message
You can notify a specific person, such as an O&M engineer, about events by phone, text message, or email. For more information, see Create an alert contact group.
Notify a group chat
You can configure a webhook to send alert messages to a group chat in DingTalk, Lark, or WeCom. For more information, see Create an alert contact group.
Push notifications to other cloud products
If the previous two methods do not meet your needs, you can push event notifications to other cloud products, such as a message queue or Function Compute. In the downstream services of these products, you can define custom alert notification logic. For more information, see Create a push channel.
After you complete this step, confirm that you have created an alert contact group or a push channel as described.
Step 2: Create an event subscription policy
You can subscribe to alert events for vertical scaling. If an exception occurs in your vertical scaling task, the system captures the event and sends a notification to the recipients that you configured in Step 1.
Log on to the Cloud Monitor console. In the navigation pane on the left, choose to open the Event Subscription page.
On the Subscription Policies tab, click Create Subscription Policy to open the Create Subscription Policy page.
In the Basic Information section, complete the configuration as prompted.
Configure Alert Subscription.
The following describes the main configuration items.
Configuration Item
Description
Example
Subscription Type
Select System Event. System events include various cloud product failures and O&M events. Subscribe to system events to receive notifications or trigger actions in external systems when events occur.
System Event
Product
Select Orchestration.
Orchestration
Event Type
Select .
Status Notification
Event Name
Select . You can also select to receive more detailed change notifications.
Template Execution Status Change
Event Level
Select a level as needed.
Critical
Event Content
Enter
ACS-ECS-ModifyInstanceSpec. This is the name of the OOS template that performs vertical scaling.ACS-ECS-ModifyInstanceSpecConfigure Noise Reduction as needed.
Configure Notifications or Push & Integration.
Complete the configuration based on the event recipient method that you configured in Step 1.
Notify by email, phone, text message, or group chat
If you created an alert contact group in Step 1 to receive notifications by email, phone, text message, or group chat, follow these steps to configure Notifications.
Configure .
From the drop-down list, click Create Notification Configuration to open the Create Notification Configuration page.
Complete the configuration as prompted, and then click OK. The following table describes the configuration items.
Configuration Item
Description
Example
Name
Configure this item as prompted.
Vertical Scaling Notification Configuration
Notification Settings
The default value is Set Notification Group Directly. You can also select Set Notification Group by Severity Level for more granular notifications.
Set Notification Group Directly
Contact Group
Select the alert contact group that you created in Step 1.
test-group
Configure Custom Notification Method. You can configure different notification templates and alert levels for different notification methods as required.
Push notifications to other cloud products
If you created a push channel in Step 1 to push notifications to other cloud products, follow these steps to configure Push & Integration.
Under , click Add Channel and select the push channel that you created in Step 1 from the drop-down list.
Review the configuration and click Submit to create the event subscription policy.
Verify the feature (Optional)
Spot instances do not support vertical scaling. Therefore, a vertical scaling task fails if you configure it for a spot instance. You can use this behavior to verify your configuration. Configure a vertical scaling task for a spot instance. If you receive an event notification after the task is complete, it indicates that the configuration is effective.
Verification steps:
Log on to the ECS console and create a spot instance. For more information, see Create a spot instance.
Log on to the Auto Scaling console, create a vertical scaling task for the spot ECS instance, and set it to run immediately. For more information, see Configure a vertical scaling task.
Wait for the vertical scaling task to complete and verify that the event notification works.