Skip to main content

Rollingspanlatency Processor

Status Available in: contrib Maintainers: @atoulme, @rnterbush, @pavankrish123 Source: opentelemetry-collector-contrib

Supported Telemetry

Traces

Overview

Labels spans as slow or very_slow based on a per-key rolling latency baseline, so that downstream tail-sampling, alerting, or routing decisions can react to spans that are anomalously slow relative to their own historical behavior rather than a fixed static threshold. For each incoming span, the processor computes a key from the span name and a configurable set of resource attributes (e.g. service name, namespace, deployment environment), and maintains an exponentially-weighted moving average (EWMA) of that key’s duration. Once a key has accumulated enough observations to warm up, spans whose duration deviates from the rolling mean by more than a configured number of standard deviations are labeled accordingly.

Configuration

Filtering which spans are evaluated

By default, with both span_kinds and always_include_root_spans left unset, every span — including root spans — is tracked and eligible for labeling; neither option excludes anything on its own. Setting either option switches the processor into filtering mode, where a span is tracked only if it matches one of the two criteria below: Spans that don’t match are passed through unmodified and never contribute to a baseline. Note the second row: setting always_include_root_spans: true by itself does not add root spans on top of “track everything” — since span_kinds contributes no matches when it’s empty, the processor narrows to root spans only. Set span_kinds too if you want root spans plus specific kinds.

Warnings

resource_key_attributes combined with the span name determines the cardinality of tracked baselines. Choosing attributes with many unique values (e.g. a per-request ID) can lead to unbounded memory growth; use max_baselines to bound this and watch for the high-cardinality warning gated by churn_warning_ratio.
Last generated: 2026-11-09