I Tried Enabling the Newly Free Basic OpenTelemetry Enrichment and Retrieving Lambda Metrics with PromQL

I Tried Enabling the Newly Free Basic OpenTelemetry Enrichment and Retrieving Lambda Metrics with PromQL

With start-otel-enrichment, I enabled Basic OpenTelemetry enrichment, skipping the billable resource tag enrichment ($0.50 per GB ingested), and was able to query Lambda Invocations with PromQL.
2026.11.28

This page has been translated by machine translation. View original

Introduction

On November 27, 2026, Basic OpenTelemetry enrichment for Amazon CloudWatch was released.

https://aws.amazon.com/jp/about-aws/whats-new/2026/11/amazon-cloudwatch-opentelemetry-enrichment/

This feature converts those metrics that AWS services send to CloudWatch and that can identify a resource into OpenTelemetry data points. The converted data points can be queried with PromQL.

In this article, I enable Basic enrichment, retrieve Lambda metrics with PromQL, and check the labels attached to the series and the values compared with the conventional API.

Test environment

  • Region: Tokyo (ap-northeast-1)
  • Initial state: Status of get-otel-enrichment was Stopped
  • AWS CLI: 2.42.5 (Docker image amazon/aws-cli)
  • curl: 8.18.0 (using --aws-sigv4 to call the PromQL HTTP API)
  • Enabled level: Basic
  • Metric source: an idle Lambda function, otel-enrich-verify-fn (Python 3.13)

Enabling

Use start-otel-enrichment to enable it. The levels and how to enable them are described on the following page.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-OTelEnrichment.html

If you omit EnableTagEnrichment, the billable resource tag enrichment is enabled. To use only Basic, explicitly set it to false with --no-enable-tag-enrichment.

aws cloudwatch start-otel-enrichment --no-enable-tag-enrichment
{
    "CreatedAt": "2026-11-28T04:33:36.710000+00:00",
    "UpdatedAt": "2026-11-28T04:33:36.710000+00:00",
    "EnableTagEnrichment": false
}

Immediately afterward, I checked the status with get-otel-enrichment.

aws cloudwatch get-otel-enrichment
{
    "Status": "Running",
    "CreatedAt": "2026-11-28T04:33:36.710000+00:00",
    "UpdatedAt": "2026-11-28T04:33:36.710000+00:00",
    "EnableTagEnrichment": false
}

This time, I was able to confirm values with PromQL about 3.5 minutes after enabling it.

PromQL queries

The endpoint of the PromQL HTTP API and SigV4 signing are explained in the following article.

https://dev.classmethod.jp/articles/cloudwatch-otel-metrics-ga-otlp-promql/

I called the API with the following script that uses curl's --aws-sigv4. I saved it with the file name promql-query and gave it execute permission. Temporary credentials are passed through three environment variables: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN.

promql-query
#!/usr/bin/env bash
# Call CloudWatch's Prometheus-compatible HTTP API with a SigV4 signature.
# Usage: promql-query <operation> [curl --data-urlencode arguments...]
#   Example: promql-query query 'query=Invocations{FunctionName="otel-enrich-verify-fn"}'
# Credentials are read from environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN).
set -euo pipefail
op="$1"; shift
region="${AWS_REGION:-ap-northeast-1}"
args=()
for kv in "$@"; do args+=(--data-urlencode "$kv"); done
exec curl -sS --fail-with-body -X POST \
  --aws-sigv4 "aws:amz:${region}:monitoring" \
  --user "${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}" \
  -H "x-amz-security-token: ${AWS_SESSION_TOKEN}" \
  "${args[@]}" \
  "https://monitoring.${region}.amazonaws.com/api/v1/${op}"

Lambda's Invocations could be retrieved in either of the following formats.

./promql-query query 'query={"Invocations", FunctionName="otel-enrich-verify-fn"}'
./promql-query query 'query=Invocations{FunctionName="otel-enrich-verify-fn"}'

The response to the first query is as follows. There was one series.

{
  "status": "success",
  "data": {
    "resultType": "vector",
    "result": [
      {
        "metric": {
          "@aws.account": "123456789012",
          "@aws.region": "ap-northeast-1",
          "@instrumentation.@name": "cloudwatch.aws/lambda",
          "@instrumentation.cloudwatch.solution": "CloudWatchOTelEnrichment",
          "@instrumentation.cloudwatch.source": "aws.lambda",
          "@resource.cloud.account.id": "123456789012",
          "@resource.cloud.provider": "aws",
          "@resource.cloud.region": "ap-northeast-1",
          "@resource.cloud.resource_id": "arn:aws:lambda:ap-northeast-1:123456789012:function:otel-enrich-verify-fn",
          "FunctionName": "otel-enrich-verify-fn",
          "Resource": "otel-enrich-verify-fn",
          "__monotonicity__": "true",
          "__name__": "Invocations",
          "__temporality__": "delta",
          "__type__": "Sum",
          "__unit__": "{count}"
        },
        "value": [1795840731.761, "1"]
      }
    ]
  }
}

Labels attached to the series

The labels attached to the series fall into the following categories.

Category Labels
Original dimensions FunctionName, Resource
Resource attributes @resource.cloud.resource_id (ARN), @resource.cloud.provider, @resource.cloud.region, @resource.cloud.account.id
Instrumentation scope @instrumentation.@name, @instrumentation.cloudwatch.source, @instrumentation.cloudwatch.solution
System labels indicating the ingestion destination @aws.account, @aws.region
Series attributes __name__, __type__, __temporality__, __unit__, __monotonicity__

Resource tag labels (@aws.tag.*) are attached only when resource tag enrichment is enabled. Filtering and aggregation using tags are tested in the following article.

https://dev.classmethod.jp/articles/cloudwatch-otel-vended-metric-enrichment-promql/

Comparison with the conventional API

I retrieved the same Lambda Invocations with the conventional get-metric-statistics and with a PromQL range selector, and lined them up minute by minute. Using a range selector, you can retrieve the raw samples for each minute.

aws cloudwatch get-metric-statistics --namespace AWS/Lambda --metric-name Invocations --dimensions Name=FunctionName,Value=otel-enrich-verify-fn --start-time 2026-11-28T13:30:00+09:00 --end-time 2026-11-28T13:55:00+09:00 --period 60 --statistics Sum SampleCount --output json
./promql-query query 'query={"Invocations", FunctionName="otel-enrich-verify-fn"}[30m]'

The following table is an excerpt from the results, covering the Lambda function invoked once at 13:37:05 and five times between 13:43:02 and 13:43:04.

Minute (JST) Invocations Sum from get-metric-statistics PromQL sample
13:37 1 1 1
13:43 5 5 5

All three values matched in both minutes.

The conventional API has two metrics: one whose only dimension is FunctionName, and one that has both FunctionName and Resource. What could be retrieved with PromQL was the one with Resource.

Summary

Native support for OTel metrics was already GA in June 2026, but when using AWS service metrics with PromQL, resource tag enrichment (EnableTagEnrichment set to true) could not be omitted, and ingestion cost $0.50 per GB.

With this update, you can choose Basic enrichment, which omits the billable resource tag enrichment, and use AWS service metrics from PromQL without ingestion cost.

PromQL lets you write queries more flexibly than conventional Classic metrics, and it continues to evolve, for example by supporting 30-day query windows.

https://dev.classmethod.jp/articles/cloudwatch-promql-30day-query-window/

If you want to organize alarms and dashboards that use PromQL in an environment where resources change little and there is little need to use tags, give Basic enrichment a try.

Share this article

AWSのお困り事はクラスメソッドへ