Metricsgeneration Processor
contrib
Maintainers: @Aneurysm9, @crobert-1
Source: opentelemetry-collector-contrib
Supported Telemetry
Overview
Description
The metrics generation processor (metricsgeneration) can be used to create new metrics using existing metrics following a given rule. This processor currently supports the following two rule types for creating a new metric.
calculate: It can create a new metric from two existing metrics by applying one of the following arithmetic operations: add, subtract, multiply, divide, or percent. One use case is to calculate thepod.memory.utilizationmetric like the following equation-pod.memory.utilization= (pod.memory.usage.bytes/node.memory.limit)scale: It can create a new metric by scaling the value of an existing metric with a given constant number. One use case is to convertpod.memory.usagemetric values from Megabytes to Bytes (multiply the existing metric’s value by 1,048,576)
calculate Rule Functionality
There are some specific behaviors of the calculate metric generation rule that users may want to be aware of:
- The created metric will have the same type as the metric configured as
metric1. - If no valid data points are calculated for the metric being created, it will not be created. This ensures the processor is not emitting new metrics that are empty.
- Users may want to have metric calculations done on data points whose overlapping attributes match. To enable this
behavior, please enable the feature gate
metricsgeneration.MatchAttributes. This feature gate is disabled by default, meaning the value used formetric2during the calculations is simply the first data point’s value. Refer to documentation for more information on how to enable and disable feature gates.
Configuration
Configuration is specified through a list of generation rules. Generation rules find the metrics which match the given metric names and apply the specified operation to those metrics.Example Configurations
Create a new metric using two existing metrics
Create a new metric scaling the value of an existing metric
Configuration
config.yaml (testdata)
config.yaml (testdata)
config.yaml (testdata)
config.yaml (testdata)
config.yaml (testdata)
Last generated: 2026-04-13