All Products
Search
Document Center

Managed Service for Prometheus:Add custom tags to ECS instance metrics in a VPC

Last Updated:Jun 08, 2026

Add custom key-value tags to Prometheus-collected ECS metrics in a VPC for fine-grained filtering and analysis in tools such as Grafana.

Prerequisites

Usage notes

  • Tag keys cannot contain hyphens (-), periods (.), percent signs (%), or other special characters reserved by Prometheus.

  • Tags must use a format required by Prometheus.

Procedure

Choose one of the following methods:

Method 1: Automatically add tags

Tags with the o11y.aliyun.dev/ prefix are automatically injected into metrics, simplifying filtering and management.

Note

Tags with the o11y.aliyun.dev/ prefix are automatically injected into the corresponding metrics.

  1. Configure tags for the ECS instance. Modify the tags of an instance.

    image

  2. On the Metric Exploration tab of the environment details page in Integration Management, tags have been added. Explore the metric data of an environment.

    image

Note
  • Enable the ECS component first. Monitor ECS instances.

  • Automatic prefix-based tag injection applies only to Node Exporter metrics.

Method 2: Manually add tags

Manually specify custom tags when enabling the ECS component. Separate multiple tags with commas (,).

  1. Configure tags for the ECS instance. Modify the tags of an instance.

    image

  2. In the Host Monitor panel, enter the tag keys from the previous step in the Custom ECS Tag Injection field. Monitor ECS instances.

    image

  3. On the Metric Exploration tab of the environment details page in Integration Management, tags have been added. Explore the metric data of an environment.

    image