Try it free

Metric extraction stage in OpenPipeline

  • Latest Dynatrace
  • Explanation
  • 5-min read
  • Published Aug 20, 2026

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.

Processors

The processors in the stage are:

  • Counter metric
  • Histogram metric
  • Value metric
  • Spans Sampling aware counter metric
  • Spans Sampling aware histogram metric
  • Spans Sampling aware value metric

Each processor creates a new metric data point for each matching record. The source record is not modified.

Counter metric

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.

Parameters

ParameterDescriptionRequired

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, my.metric.

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

Example: Count HTTP errors per status code

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:

  • Metric key: log.http.errors
  • Dimensions (Field name): source http.status_code, destination status_code

Unprocessed

{
"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.

Histogram 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.

Parameters

ParameterDescriptionRequired

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, my.metric.

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

Example: Track request duration distribution

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:

  • Field extraction: request.duration_ms
  • Default value: 0
  • Metric key: log.request.duration
  • Dimensions (Field name): source service.name

Unprocessed

{
"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.

Value metric

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.

Parameters

ParameterDescriptionRequired

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, my.metric.

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

Example: Extract memory usage from log records

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:

  • Field extraction: memory.usage_percent
  • Default value: 0
  • Metric key: log.memory.usage
  • Dimensions (Field name): source service.name

Unprocessed

{
"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.

Sampling aware settings Spans

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.

ParameterDescriptionRequired

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.

Use cases

  • Count error responses, failed logins, or deployment events as custom metrics.
  • Track latency distributions by extracting duration fields from spans or logs as histogram metrics.
  • Monitor resource usage by recording CPU, memory, or disk values as gauge metrics.
  • Measure business throughput such as the number of orders or transactions per interval.
Related tags
Dynatrace PlatformOpenPipelineOpenPipeline