Set event notifications for vertical scaling tasks

Updated at:
Copy as MD

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.

Note

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.

Important

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.

  1. Log on to the Cloud Monitor console. In the navigation pane on the left, choose Event Hub > Event Subscription to open the Event Subscription page.

  2. On the Subscription Policies tab, click Create Subscription Policy to open the Create Subscription Policy page.

  3. In the Basic Information section, complete the configuration as prompted.

  4. 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 Orchestration > Status Notification.

    Status Notification

    Event Name

    Select Orchestration > Template Execution Status Change. You can also select Orchestration > Task Execution Status Change 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-ModifyInstanceSpec

  5. Configure Noise Reduction as needed.

  6. 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.

    1. Configure Notifications > Notification Configuration.

      1. From the drop-down list, click Create Notification Configuration to open the Create Notification Configuration page.

      2. 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

    2. 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 Push & Integration > Push Channel, click Add Channel and select the push channel that you created in Step 1 from the drop-down list.

  7. 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.