Spanmetrics Processor
Overview
| Status | |
|---|---|
| Stability | deprecated |
| Supported pipeline types | traces |
| Distributions | contrib |
spanmetrics processor is deprecated in favour of the spanmetrics connector.
Note: Currently experimental and subject to breaking changes (e.g. change from processor to exporter/translator component).
See: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/403.
Aggregates Request, Error and Duration (R.E.D) metrics from span data.
Request counts are computed as the number of spans seen per unique set of dimensions, including Errors.
For example, the following metric shows 142 calls:
service_name and operation.
Error counts are computed from the Request counts which have an βErrorβ Status Code metric dimension.
For example, the following metric indicates 220 errors:
- Service name
- Operation
- Span kind
- Status code
metrics_exporter: the name of the exporter that this processor will write metrics to. This exporter must be present in a pipeline.
-
latency_histogram_buckets: the list of durations defining the latency histogram buckets.- Default:
[2ms, 4ms, 6ms, 8ms, 10ms, 50ms, 100ms, 200ms, 400ms, 800ms, 1s, 1400ms, 2s, 5s, 10s, 15s]
- Default:
-
dimensions: the list of dimensions to add together with the default dimensions defined above. Each additional dimension is defined with anamewhich is looked up in the spanβs collection of attributes or resource attributes (AKA process tags) such asip,host.nameorregion. If thenamed attribute is missing in the span, the optional provideddefaultis used. If nodefaultis provided, this dimension will be omitted from the metric. -
dimensions_cache_size: the max items number ofmetric_key_to_dimensions_cache. If not provided, will use default value size1000. -
aggregation_temporality: Defines the aggregation temporality of the generated metrics. One of eitherAGGREGATION_TEMPORALITY_CUMULATIVEorAGGREGATION_TEMPORALITY_DELTA.- Default:
AGGREGATION_TEMPORALITY_CUMULATIVE
- Default:
-
namespace: Defines the namespace of the generated metrics. Ifnamespaceprovided, generated metric name will be addednamespace.prefix.
Examples
The following is a simple example usage of the spanmetrics processor. For configuration examples on other use cases, please refer to More Examples. The full list of settings exposed for this processor are documented here.More Examples
For more example configuration covering various other use cases, please visit the testdata directory.Configuration
Example Configuration
Last generated: 2026-04-14