You can add the same tag to Elastic Compute Service (ECS) instances that run the same business. Then, you can use the application group feature of CloudMonitor to configure smart tag synchronization for these instances. CloudMonitor assigns ECS instances with the same tag to the same application group to automatically monitor the instances in the group. In ECS, only ECS instances support automatic resource monitoring by group based on tags.

Background information

The application group feature of CloudMonitor allows you to manage alert rules and view monitoring data by group, which reduces management complexity. For more information, see Create an application group. ECS instances with a specified tag are automatically identified and assigned to an application group based on the configuration rule of the group. In this topic, instances that are automatically created in a scaling group and that have the testKey:testValue tag added are used, and the instances are identified and assigned to an application group that has the testKey:testValue tag added.

You can use one of the following methods to implement automatic resource monitoring by group based on tags:

  • Create resources that have tags added or add tags to existing resources. Then, use CloudMonitor to create an application group that supports smart tag synchronization. Make sure that the tags of the application group are the same as those of the resources.
  • Create an application group that supports smart tag synchronization, and add a custom tag to the matching rule of the application group. Then, create resources that have the tag added or add the tag to existing resources. The resources are automatically assigned to the application group.

Step 1: Create instances that have a specified tag add

You can create instances that have a specified tag added or add a specified tag to existing instances. For more information, see Create or bind a tag. Alternatively, you can perform the following operations to use Auto Scaling to add a specified tag to the instances in a scaling group:

  1. Log on to the Auto Scaling console.
  2. Create a scaling group.
    For more information, see Create a scaling group. In this example, the following operations are performed:
    • Set Minimum Number of Instances to 4.
    • Specify Scaling Policy based on your business requirements to implement high-availability auto scaling.
    1
  3. Create a scaling configuration.
    For more information, see Create a scaling configuration (ECS). You must add the testKey:testValue tag in the System Configurations (Optional) step. 1
  4. Go to the scaling group details page, click the Instances tab, and then view the ECS instances that are automatically created in the scaling group.
    1

Step 2: Create a CloudMonitor application group

  1. Log on to the CloudMonitor console.
  2. Create a CloudMonitor application group. For more information, see Create an application group.
    In this example, Creation Method is set to Create Based on Tags and the testKey:testValue tag is added to the matching rule of an application group. Then, the instances that have the tag added are assigned to the application group.
    1. Set Creation Method to Create Based on Tags.
      1
    2. Set Resource Tag Key to testKey and specify the Tag Value parameter based on your needs. In this example, select Contain from the Tag Value drop-down list and enter testValue in the Tag Value field.
      1

Step 3: View monitoring information of the ECS instances

You can use one of the following methods to view the information of the ECS instances:

Method 1: View the monitoring information about the ECS instances based on their application group in the CloudMonitor console.

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, click Application Groups.
  3. On the Application Group tab, select Resource Tag from the drop-down list, enter testKey in the search box, and then click Search.
    1
  4. Click testKey-testValue-53** / 22****** in the Group Name / Group ID column to view the resources in the group.
    The ECS instances that are automatically created in the scaling group are automatically added to the application group. 1

Method 2: View the monitoring information of the ECS instances in the ECS console.

  1. Log on to the ECS console.
  2. In the left-side navigation pane, click Tags.
  3. In the top navigation bar, select a region.
  4. On the Tags page, click the Custom Tags tab.
  5. Enter testKey in the search box to search for the tag.
  6. Click View Monitoring Details in the Actions column.
    tag2
    Go to the Monitoring tab to view the monitoring, alert, and event information of the ECS instances in the application group that has the tag added.

What to do next

You can monitor ECS instances in real time by using CloudMonitor. For more information, see Overview.