All Products
Search
Document Center

ApsaraMQ for Kafka:Manage tags

Last Updated:Aug 17, 2023

This topic describes how to add tags to ApsaraMQ for Kafka resources such as instances, topics, and consumer groups, and how to manage the tags. Tags can be used to categorize ApsaraMQ for Kafka resources for efficient management.

Background information

A tag consists of a tag key and a tag value and is used to mark ApsaraMQ for Kafka resources. If you have multiple types of ApsaraMQ for Kafka resources in your account that are associated between each other in various ways, you can use tags to categorize your resources based on their purposes and relationships. This way, you can efficiently search for resources, perform batch operations, and fix problems during routine O&M or troubleshooting.

Usage notes

  • Each tag consists of a key:value pair.

  • Each tag key must be unique within a resource.

    For example, the city:shanghai tag is added to a ApsaraMQ for Kafka instance. If you add the city:newyork tag to the instance, the city:shanghai tag is automatically removed from the instance.

  • Tag information is not shared across regions. For example, tags that are created in the China (Hangzhou) region are invisible to the China (Shanghai) region.

  • After you remove a tag from a resource, the system automatically deletes the tag if the tag is not added to other resources.

  • For more information about tag design, see Best practices for tag design.

Limits

  • A maximum of 20 tags can be added to a resource.

  • A tag can be added to a maximum of 50 resources.

  • A maximum of 20 tags can be added at a time.

Add tags

You can add tags to ApsaraMQ for Kafka resources such as instances, topics, and consumer groups to categorize your resources

  1. Log on to the ApsaraMQ for Kafka console. In the Resource Distribution section of the Overview page, click the name of the region where your instance is deployed.
  2. In the left-side navigation pane, choose Common Tools & Links > Tags.

  3. On the Tags page, click Create Tag.

  4. In the Select Tag step of the Create Tag wizard, configure a tag and click Next.

    Important

    You can configure a maximum of 20 tags at a time. Each tag must be unique.

    1. Enter a tag key in the Tag Key field or select an existing tag key from the Label key drop-down list.

    2. Enter a tag value in the Tag Value field or select an existing tag value from the Label value drop-down list.

  5. In the Bind Resource step of the Create Tag wizard, add the created tag to a resource and click Bind.

    Important

    You can select up to 50 resources of the same type.

    • Click the Instances tab and select one or more instances to which the tag is to be added.

    • Click the Topics tab and select one or more topics to which the tag is to be added.

    • Click the Groups tab and select one or more consumer groups to which the tag is to be added.

    On the Tags page, you can view the created tag and the resources to which the tag is added. To add the tag to more resources, click Bind Resource in the Actions column.

Edit tags

If the tags of an instance cannot help you efficiently categorize or search for resources, you can add other existing or new tags to the instance.

Edit the tags of an instance, a topic, or a consumer group based on your business requirements.

  • Edit tags of instances

    1. On the Instances page, find the instance whose tag you want to edit, move the pointer over the tag icon in the Tag column, and then click Edit.

    2. In the Edit Tags for Instance panel, find the tag key to be edited.

    3. Edit the tag key in the Tag Key field, edit the tag value in the Tag Value field, and then click OK.

  • Edit tags of topics

    1. On the Instances page, click the name of the instance that you want to manage.

    2. In the left-side navigation pane, click Topics.

    3. On the Topics page, find the topic whose tag you want to edit, move the pointer over the tag icon in the Tag column, and then click Edit.

    4. In the Edit Tags for Topic panel, find the tag key to be edited.

    5. Edit the tag key in the Tag Key field, edit the tag value in the Tag Value field, and then click OK.

  • Edit tags of consumer groups

    1. On the Instances page, click the name of the instance that you want to manage.

    2. In the left-side navigation pane, click Groups.

    3. On the Groups page, find the consumer group whose tag you want to edit, move the pointer over the tag icon in the Tag column, and then click Edit.

    4. In the Edit Tags for Group panel, find the tag key to be edited.

    5. Edit the tag key in the Tag Key field, edit the tag value in the Tag Value field, and then click OK.

Use tags to search for resources

After you add a tag to a resource, you can search for the resource by using this tag.

  1. On the Tags page, select the tag key that you want to use from the Select Tag Key drop-down list. Then, the tag values that correspond to the tag key appear. Enter the tag value that you want to use in the search box and click the Search icon. Then, click Details in the Actions column of the tag value.

    Note

    If no tag value is available, Null appears.

  2. On the Tag Details page, you can view the resources to which the tag is added on the Instances, Topics, and Groups tabs.

Remove tags

If an unsuitable tag is added to resources or a tag can no longer help you efficiently manage or search for resources, you can remove the tag from one or more resources at a time.

Important

After a tag is removed from a resource, the tag is automatically deleted if it is not added to other resources.

  1. On the Tags page, select the tag key that you want to remove from the Select Tag Key drop-down list. Then, the tag values that correspond to the tag key appear. Find the tag value that you want to remove and click Details in the Actions column.

  2. On the Tag Details page, select one or more resources from which you want to remove the tag on the Instances, Topics, or Groups tab.

    • Remove a tag from a single resource: In the resource list, find the resource from which you want to remove the tag and click Unbind Resource in the Actions column.

    • Remove a tag from multiple resources at a time: In the resource list, select the resources from which you want to remove the tag and click Unbind Resource below the resource list.

  3. In the Note message, read the note and click OK.