You can bind a tag to multiple ECS instances that run the same business. Then, you can use the application groups feature of Cloud Monitor to configure smart tag synchronization for these instances. Cloud Monitor automatically assigns the ECS instances that are bound with the same tag to the same application group to implement automatic resource monitoring by group. In ECS, only ECS instances support this feature.

Background information

The application groups feature of Cloud Monitor allows you to manage alarm rules and view monitoring data by group. This makes management less complex. For more information, see Application groups. In this topic, ECS instances that are automatically created in a scaling group are bound with the testKey:testValue tag. Then, Cloud Monitor uses the configuration rules of the application group to identify and assign the ECS instances to the application group based on the tag.

You can use one of the following methods to automatically monitor resources by group based on tags.

  • Create resources that are bound with tags or bind tags to existing resources. Then, use Cloud Monitor to create an application group for which the smart tag synchronization feature is enabled. Make sure that the tags that match the application group are the same as those bound to the resources.
  • Create an application group for which the smart tag synchronization feature is enabled, and add a custom tag to the matching rules of the application group. Then, create resources that are bound with the same tag as the application group or bind the same tag as the application group to existing resources. Then, the resources are automatically assigned to the application group.

Step 1: Create instances that are bound with the same tag

You can create instances that are bound with the same tag or bind a 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 bind a tag to the instances in a scaling group.

  1. Log on to the Auto Scaling console.
  2. Create a scaling group.
    Select a multi-zone scaling policy to implement high-availability auto scaling. For more information, see Create a scaling group.1
  3. Create a scaling configuration.
    Make sure that the testKey:testValue tag is bound to the scaling configuration. For more information, see Create a scaling configuration.1
  4. Go to the details page of the created scaling group. click Instances to view the ECS instances that are automatically created in the scaling group.
    1

Step 2: Create a Cloud Monitor application group

  1. Log on to the Cloud Monitor console.
  2. Create a Cloud Monitor application group. For more information, see Create an application group.
    In this example, select Smart tag synchronization creation as the creation method, and add the testKey:testValue tag to the matching rule to create an application group. Then, the instances that are bound with this tag are assigned to the created application group.
    1. Select Smart tag synchronization creation as the creation method.1
    2. In the Match Rule section, set Resource Tag Key to testKey and specify the Tag Value parameter. You can set a tag value range. In this example, the tag value range is ContaintestValue.1

Step 3: View monitoring information about the ECS instances

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

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

  1. Log on to the Cloud Monitor console.
  2. In the left-side navigation pane, click Application Groups.
  3. In the search bar, select Resource tags, and enter testKey to search for the application group.
    1
  4. Click testKey-testValue-53** / 22****** in the Group Name / Group ID column to view the resources in the group.
    The automatically created ECS instances in the scaling group are automatically assigned to the application group.1

Method 2: View the monitoring information about 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 tab of the Tags page, click Custom Tags.
    On the All Custom Tags page, click Enable in the Automatically Create Cloud Monitoring Application Groups column to create a Cloud Monitor application group. In the Automatically Create Cloud Monitoring Application Groups column, Enabled is displayed with a green check mark for the tags for which application group are created.tag1
  5. Enter testKey in the search box to search for the testKey:testValue tag.
  6. Click View Monitoring Information in the Cloud Monitoring Application Group column.
    tag2
    Go to the CloudMonitor tab to view the monitoring, alarm, and event information about the ECS instances in the application group that correspond to this key.

What to do next

Monitor ECS instances in real time by using Cloud Monitor. For more information, see Overview.