All Products
Search
Document Center

ApsaraMQ for Kafka:Manage tags

Last Updated:Dec 11, 2024

You can use tags to categorize resources. This topic describes how to add tags to ApsaraMQ for Kafka resources, such as instances, topics, and groups, to improve resource management efficiency.

Background information

A tag consists of a tag key and a tag value and can be used to label ApsaraMQ for Kafka resources. If multiple ApsaraMQ for Kafka resources that are associated with each other exist in your Alibaba Cloud account, you can use tags to categorize the resources based on functions and relationships. This way, you can efficiently search for resources, perform batch operations, and resolve issues during routine O&M and troubleshooting.

Usage notes

  • Each tag consists of a key-value pair.

  • Each tag key must be unique in a resource.

    For example, if you add the city:shanghai tag and then the city:newyork tag to an ApsaraMQ for Kafka instance, the city:shanghai tag is automatically removed from the instance.

  • Tag information is not shared across regions. For example, you cannot view tags that are created in the China (Hangzhou) region from 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 information about how to design the key-value pair of a tag, see Best practices for tags.

Limits

  • You can add up to 20 tags to a resource.

  • You can add a tag to up to 50 resources.

  • You can add up to 20 tags to resources at the same time.

Add tags

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

  1. Log on to the ApsaraMQ for Kafka console. In the Resource Distribution section of the Overview page, select the region where the ApsaraMQ for Kafka instance that you want to manage resides.

  2. In the left-side navigation pane, choose Common Tools & Links > Tags.

  3. On the Tags page, click Resource Management console.

  4. In the left-side navigation pane, choose Tag > Tag. On the page that appears, click the Custom Tags tab. Then, click Create Custom Tag.

    Important

    You can create up to 20 tags at the same time. Each tag must be unique.

  5. In the Create Custom Tag dialog box, perform the following steps:

    1. In the Create or Select Tags step, configure the parameters and click Next.

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

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

    2. In the Add to Resources step, select one of the following methods:

      Important

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

      1. Click Select from Resource List and search for resources based on the image section as shown in the following figure. Then, select the resources to which you want to add the tag and click OK.

        image

      2. Click Enter Resource IDs, select a service from the Service drop-down list, enter the resource IDs in the Resource ID field, and then click OK. Separate multiple IDs with commas (,).

On the Tag page, you can view the tag that you created. You can also click View Resources in the Actions column of the corresponding tag to view the resources to which the tag is added.

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

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

  • Modify a tag of an instance

    1. On the Instances page, find the instance that you want to manage, move the pointer over the 标签 icon in the Tag column, and then click edit.

    2. In the Edit Tags for Instance panel, find the tag key that you want to modify.

    3. In the Tag Key field, modify the tag key. In the Tag Value field, modify the tag value and click OK.

  • Modify a tag of a topic

    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 for which you want to modify a tag, move the pointer over the 标签 icon in the Tag column, and then click edit.

    4. In the Edit Tags for Topic panel, find the tag that you want to modify, configure the Label key and Label value parameters, and then click OK.

  • Modify a tag of a consumer group

    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 group that you want to manage, move the pointer over the 标签 icon in the Tag column, and then click edit.

    4. In the Edit Tags for Group panel, find the tag that you want to modify, configure the Label key and Label value parameters, and then click OK.

Note

You cannot add tags to topics and consumer groups on serverless ApsaraMQ for Kafka instances.

Use tags to retrieve resources

After you add a tag to a resource, you can retrieve the resource by using the tag.

  1. Go to the Resource Management console.

  2. In the left-side navigation pane, choose Tag > Tag. On the page that appears, click the Custom Tags tab.

  3. Perform a fuzzy search for the tag by tag key in the search box. Then, click View Resources in the Actions column of the tag.

    Note

    If no tag value is available, Empty is displayed in the Tag Value column.

  4. On the Resources tab, you can view the resources to which the tag is added.

Remove a tag from resources

If a tag is added to wrong resources or can no longer help you efficiently manage or retrieve resources, you can remove the tag from one or more resources at the same time.

Important

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

  1. Go to the Resource Management console.

  2. In the left-side navigation pane, choose Tag > Tag. On the page that appears, click the Custom Tags tab.

  3. Find the tag that you want to manage and click View Resources in the Actions column. On the Resources tab, select one or more resources from which you want to remove the tag.

    • Remove the tag from a resource: Find the resource from which you want to remove the tag and click Unbind Resource in the Actions column.

    • Remove the tag from multiple resources at the same time: Select the resources from which you want to remove the tag and choose Actions > Remove Current Tag below the resource list.

  4. In the Remove Current Tag message, click Remove.