Skip to main content

Metricstransform Processor

Status Available in: contrib, k8s Maintainers: @dmitryax Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

Description

The metrics transform processor can be used to rename metrics, and add, rename or delete label keys and values. It can also be used to perform scaling and aggregations on metrics across labels or label values. The complete list of supported operations that can be applied to one or more metrics is provided in the below table. :information_source: This processor only supports renames/aggregations within a batch of metrics. It does not do any aggregation across batches, so it is not suitable for aggregating metrics from multiple sources (e.g. multiple nodes or clients). In addition to the above:
  • Operations can be applied to one or more metrics using a strict or regexp filter
  • The action property allows metrics to be:
    • Updated in-place (update)
    • Copied and updates applied to the copy (insert)
    • Combined into a newly inserted metric that is generated by combining all data points from the set of matching metrics into a single metric (combine); the original matching metrics are also removed
  • When renaming metrics, capturing groups from the regexp filter will be expanded
  • When adding or updating a label value, {{version}} will be replaced with this collector’s version number

Configuration

Configuration is specified through a list of transformations and operations. Transformations and operations will be applied to all metrics in order so that later transformations or operations may reference the result of previous transformations or operations.

Examples

Create a new metric from an existing metric

Create a new metric from an existing metric with matching label values

Create a new metric from an existing metric with matching label values with regexp

Rename metric

Rename multiple metrics using Substitution

Add a label

Add a label to multiple metrics

Rename labels

Rename labels for multiple metrics

Rename label values

Delete by label value

Toggle datatype

Scale value

Aggregate labels

NOTE: Only the sum aggregation function is supported for histogram and exponential histogram datatypes.

Aggregate label values

NOTE: Only the sum aggregation function is supported for histogram and exponential histogram datatypes.

Combine metrics

Group Metrics

Metric Transform Processor vs. Attributes Processor for Metrics

Regarding metric support, these two processors have overlapping functionality. They can both do simple modifications of metric attribute key-value pairs. As a general rule the attributes processor has more attribute related functionality, while the metrics transform processor can do much more data manipulation. The attributes processor is preferred when the only needed functionality is overlapping, as it natively uses the official OpenTelemetry data model. However, if the metric transform processor is already in use or its extra functionality is necessary, there’s no need to migrate away from it. Shared functionality
  • Add attributes
  • Update values of attributes
Attribute processor specific functionality
  • delete
  • hash
  • extract
Metric transform processor specific functionality
  • Rename metrics
  • Delete data points
  • Toggle data type
  • Scale value
  • Aggregate across label sets
  • Aggregate across label values

Last generated: 2026-08-24