This article describes the Metric extraction stage in OpenPipeline and the available processors. In the Metric extraction stage, you can extract metrics from incoming records that match a condition.
Get familiar with OpenPipeline concepts of stage and processors. To learn more, see Processing in OpenPipeline.
The processors in the stage are:
Each processor creates a new metric data point for each matching record. The source record is not modified.
The Counter metric processor increments a counter by 1 for each matching record. Use it to count discrete events or occurrences, such as error responses, user logins, or deployments. The counter always increments by 1; no field extraction is required.
| Parameter | Description | Required |
|---|---|---|
Name | Name of the processor. | Required |
Matching condition | DQL statement that identifies the records the processor applies to. | Required |
Metric key | Key for the extracted metric, for example, | Required |
Dimensions | Metric dimensions derived from source record fields (Field name mode) or set as fixed strings (Static value mode). In Field name mode, specify the source field (Field name on record), the dimension key in the metric (Destination field name; defaults to the field name on record), and a fallback value when the field is missing (Default value). Multiple dimensions can be added to a single processor. For information about recommended fields, see Extraction stages in OpenPipeline. | Optional |
The following example counts HTTP error responses and groups them by status code.
The processor applies to all records that match the following condition:
isNotNull(http.status_code) AND toLong(http.status_code) >= 400
The processor is configured as follows:
log.http.errorshttp.status_code, destination status_codeUnprocessed
{"timestamp": "2026-06-01T10:00:00Z","http.method": "GET","http.status_code": "404","service.name": "checkout"}
The processor creates a counter metric data point log.http.errors{status_code="404"} 1.
For step-by-step tutorials using the counter metric processor, see Extract a metric to track system events and Parse log lines and extract a metric.
The Histogram metric processor reads a numeric value from a record field and records it as a histogram data point. Use it to track value distributions such as request durations, payload sizes, or queue depths.
To learn more, see Measure an important code path with histograms in OpenPipeline.
| Parameter | Description | Required |
|---|---|---|
Name | Name of the processor. | Required |
Matching condition | DQL statement that identifies the records the processor applies to. | Required |
Field extraction | Name of the record field that holds the numeric value to record as the metric value. | Required |
Default value | Numeric fallback value used when the field is missing or cannot be converted to a number. | Optional |
Metric key | Key for the extracted metric, for example, | Required |
Dimensions | Metric dimensions derived from source record fields (Field name mode) or set as fixed strings (Static value mode). In Field name mode, specify the source field (Field name on record), the dimension key in the metric (Destination field name; defaults to the field name on record), and a fallback value when the field is missing (Default value). Multiple dimensions can be added to a single processor. For information about recommended fields, see Extraction stages in OpenPipeline. | Optional |
The following example records the distribution of request durations from log records.
The processor applies to all records that match the following condition:
isNotNull(request.duration_ms)
The processor is configured as follows:
request.duration_ms0log.request.durationservice.nameUnprocessed
{"timestamp": "2026-06-01T10:00:00Z","service.name": "payment","request.duration_ms": 145.3}
The processor creates a histogram data point log.request.duration{service.name="payment"} 145.3.
For a complete walkthrough using the histogram metric processor, see Measure an important code path with histograms in OpenPipeline.
The Value metric processor reads a numeric value from a record field and records it as a gauge data point. Use it to track current states or absolute measurements such as memory usage percentages, temperature readings, or connection counts.
| Parameter | Description | Required |
|---|---|---|
Name | Name of the processor. | Required |
Matching condition | DQL statement that identifies the records the processor applies to. | Required |
Field extraction | Name of the record field that holds the numeric value to record as the metric value. | Required |
Default value | Numeric fallback value used when the field is missing or cannot be converted to a number. | Optional |
Metric key | Key for the extracted metric, for example, | Required |
Dimensions | Metric dimensions derived from source record fields (Field name mode) or set as fixed strings (Static value mode). In Field name mode, specify the source field (Field name on record), the dimension key in the metric (Destination field name; defaults to the field name on record), and a fallback value when the field is missing (Default value). Multiple dimensions can be added to a single processor. For information about recommended fields, see Extraction stages in OpenPipeline. | Optional |
The following example extracts memory usage percentages from log records and tracks them as a metric.
The processor applies to all records that match the following condition:
isNotNull(memory.usage_percent) AND matchesValue(service.name, "web-*")
The processor is configured as follows:
memory.usage_percent0log.memory.usageservice.nameUnprocessed
{"timestamp": "2026-06-01T10:00:00Z","service.name": "web-frontend","memory.usage_percent": 78.4,"content": "Memory usage alert"}
The processor creates a gauge data point log.memory.usage{service.name="web-frontend"} 78.4.
The Sampling Aware Counter Metric, Sampling Aware Histogram Metric, and Sampling Aware Value Metric processors are span-specific variants of their counterparts. They support the same parameters as their counterparts, with the following additions.
| Parameter | Description | Required |
|---|---|---|
Measurement | Selects the value source. Duration pre-sets field extraction to the span duration and enables all sampling options automatically. Custom requires specifying a field name. Applies to Sampling Aware Histogram Metric, and Sampling Aware Value Metric. | Required |
Account for aggregated spans | When enabled, adjusts the metric value to account for span aggregation. | Optional |
Extrapolate metrics to account for trace sampling | When enabled, extrapolates the metric value based on the sampling rate configured in Adaptive Traffic Management for distributed tracing. Ensures accurate results when only a fraction of spans is captured. | Optional |
Span aggregation and sampling awareness apply to all fields available in field extraction, except duration; duration aggregation is automatically detected and handled.
For step-by-step examples of configuring sampling aware processors, see Extract metrics from spans and distributed traces and Measure an important code path with histograms in OpenPipeline.