View a markdown version of this page

Enabling vended metrics in PromQL - Amazon CloudWatch
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Enabling vended metrics in PromQL

Tip

To learn more about OpenTelemetry on CloudWatch, check out the Cloud Operations Enablement workshop and event series.

You can enable OTel enrichment to make vended metrics for supported Amazon resources queryable via PromQL. Once enabled, metrics that contain a resource identifier dimension (for example, EC2 CPUUtilization with an InstanceId dimension) are enriched with resource ARN and resource tag labels and become queryable using PromQL.

The enriched metric preserves the original metric name and CloudWatch dimensions, and adds:

  • Resource attributes – the resource ARN (cloud.resource_id), cloud provider, region, and account ID.

  • Instrumentation scope – identifies the source service and marks the metric as OTel-enriched.

  • Resource tags – any Amazon resource tags associated with the resource, queryable as PromQL labels.

The original classic CloudWatch metric is not modified and remains available through existing CloudWatch APIs.

Enabling OpenTelemetry enrichment for vended metrics

Before you start OTel enrichment, you must enable resource tags on telemetry for your account.

You can enable OTel enrichment for your account in a specific region using the CloudWatch console, Amazon CLI, Amazon CloudFormation, Terraform, or Amazon SDK.

You will need permissions for the following operation: cloudwatch:StartOTelEnrichment

To enable OTel enrichment for Amazon metrics (CloudWatch Console)
  1. Open the CloudWatch console at https://console.amazonaws.cn/cloudwatch/.

  2. In the navigation pane, choose CloudWatch, then choose Settings.

  3. In the Enable OTel Enrichment for Amazon Metrics pane, toggle the feature On.

Amazon CLI

aws cloudwatch start-otel-enrichment

Amazon CloudFormation

Resources: OTelEnrichment: Type: AWS::CloudWatch::OTelEnrichment

Terraform

Note

The aws_cloudwatch_otel_enrichment Terraform resource requires the aws_observabilityadmin_telemetry_enrichment resource to be configured first.

resource "aws_observabilityadmin_telemetry_enrichment" "example" { } resource "aws_cloudwatch_otel_enrichment" "example" { depends_on = [aws_observabilityadmin_telemetry_enrichment.example] }

For more information, see aws_cloudwatch_otel_enrichment in the Terraform Registry.

To enable across multiple regions, create the same resource in each regional stack or invoke the API in each region of interest.

Once enrichment is enabled, you can start querying vended metrics via PromQL. See: Querying vended Amazon metrics with PromQL.