Edge Delta Extract Metric Node
4 minute read
The Extract Metric Node processes incoming data based on specified rules to generate metrics. This node can evaluate attributes and apply conditions to extract meaningful metrics.
- incoming_data_types: archive, cluster_pattern_and_sample, custom, diagnostic, health, heartbeat, log, metric, signal, source, source_samples, splunk_payload, trace
- outgoing_data_types: archive, cluster_pattern_and_sample, custom, diagnostic, health, heartbeat, log, metric, signal, source, source_samples, splunk_payload, trace
Example Configuration
The following node is configured with two metric rules:

nodes:
- name: extract_metric_example
type: extract_metric
extract_metric_rules:
- name: "sum_metric"
description: "An extracted sum metric"
unit: "1" # Can be either "1" or "b"
conditions:
- resource["container.name"] == "foo" # OTTL conditions are OR'ed together
sum:
aggregation_temporality: cumulative # Can be either "cumulative" or "delta"
is_monotonic: true
value: Int(attributes["foo"]) * 200 # An OTTL expression
- name: "gauge_metric"
description: "An extracted gauge metric"
unit: "b"
conditions:
- resource["container.name"] == "bar"
gauge:
value: Int(attributes["hello"]) / 1000
In this example, each rule under the extract_metric_rules
parameter specifies a metric to be extracted. The rule with the name sum_metric
describes a sum
type metric where the unit is set to “1”, indicating a count
. It includes conditions to be checked using OTTL (OpenTelemetry Transformation Language) expressions, ensuring that only data meeting these conditions—such as the container name equalling “foo”—contribute to the metric. The rule also specifies that the metric’s aggregation temporality is cumulative
, meaning the values accumulate over time, and it deems the metric as monotonically increasing. The value of the metric is computed using an OTTL expression, which multiplies the “foo” attribute by 200
. Similarly, the gauge_metric
rule sets up a gauge-type metric, with the unit as “b” for bytes
, and applies a matching condition for containers named “bar”. Here, the metric’s value is derived by dividing the “hello” attribute by 1000
.
Required Parameters
name
A descriptive name for the node. This is the name that will appear in Visual Pipelines and you can reference this node in the YAML using the name. It must be unique across all nodes. It is a YAML list element so it begins with a -
and a space followed by the string. It is a required parameter for all nodes.
nodes:
- name: <node name>
type: <node type>
type: extract_metric
The type
parameter specifies the type of node being configured. It is specified as a string from a closed list of node types. It is a required parameter.
nodes:
- name: <node name>
type: <node type>
extract_metric_rules
Defines the rules for metric extraction. At least one metric rules group is required.
name
Name of the metric to be extracted.
description
Description of the metric to be extracted.
unit
Unit of the metric, either “1” (Count) or “b” (Byte).
conditions
OTTL conditions required for the metric extraction.
sum
Defines settings for sum type metrics:
- aggregation_temporality: Sets to “cumulative” or “delta”.
In cumulative temporality, the metric data is aggregated from a starting point and continues to accumulate over time. Each measurement point represents the total count or sum from the beginning of the measurement period until that point in time. This means that each report includes all previous data points, essentially showing a running total or aggregate. For example, if you are collecting data on the number of requests served, a cumulative count would show the total number of requests from the start of the monitoring period to the current point, increasing as more requests are served. Delta Aggregation Temporality:
Delta temporality, on the other hand, captures the change in the metric value between two reporting intervals. Each measurement point reflects only the data that has changed since the last report, not the entire accumulation. Using the same example, a delta count of requests would show only the number of requests that occurred since the last measurement period, providing insight into the rate of change over each interval, rather than an ongoing total.
- is_monotonic: Boolean to set for monotonically increasing values.
When is_monotonic
is set to true
, it implies that the metric values will only increase (in the case of counts or aggregations) or only decrease (in some less common scenarios). This is typical for metrics that represent counters, like the number of requests served or errors encountered, where the count should logically only increase over time as more events occur. Monotonic metrics are particularly useful in analyzing trends over time and can be beneficial for calculating rates, such as requests per second, as they can assume that negative differences will not occur in subsequent readings.
Setting is_monotonic
to false
indicates that the metric values can increase or decrease. This is applicable to metrics representing values like system load or network throughput, which might fluctuate both up and down based on the conditions.
- value: OTTL expression for determining the value through, if required, mathematical operations. It evaluates to an integer or double.
gauge
Settings for gauge type metrics:
- value: OTTL expression for determining the value through, if required, mathematical operations. It evaluates to an integer or double.