# TraceReducer

Reduces trace volume by applying a uniform trace head sampling rate and configurable span head sampling rules with optional tail sampling, then emits the retained spans.

**Type**: `object`

## Properties

- name: actions (optional)
  type: array of `TraceAction`
  description: Actions to execute on traces. Actions process spans after sampling decisions have been made and can trigger operations like logs backfill.

- name: criticalPathAnalysis (optional)
  type: `CriticalPathAnalysisConfig`

- name: datasetId (optional)
  type: string
  description: Dataset ID used for naming the Iceberg table (traces_raw_{datasetId}). If not provided, traces will not be persisted to Iceberg.

- name: name (required)
  type: string

- name: siblingMergeRules (optional)
  type: array of `SiblingMergeRule`
  description: Rules that merge same-signature sibling spans matching a predicate, after tail sampling decisions. The earliest-start match is kept with its children; the other matching same-signature siblings are removed and counted under grepr.merged_siblings. Requires tail sampling to be configured.

- name: spanDropRules (optional)
  type: array of `SpanDropRule`
  description: Rules that drop matching spans and their descendants after tail sampling decisions. Requires tail sampling to be configured.

- name: spanHeadSamplingRules (optional)
  type: array of `SpanHeadSamplingRule`
  description: Span head sampling rules. Matched spans are retained as SPAN_HEAD_SAMPLED. If tail sampling is configured, matched spans participate in trace assembly before output; otherwise, matched spans are emitted directly. Order is significant; first match wins for metric attribution. Trace head sampling wins when both match the same span.

- name: tailSampling (optional)
  type: `TailSamplingConfig`

- name: traceHeadSamplingRate (optional)
  type: number
  description: Uniform trace head sampling rate in [0.0, 1.0]. When set, all spans sharing a traceId are retained together as HEAD_SAMPLED at this probability. Mutually exclusive with traceHeadSamplingRules (scalar wins when both present).

- name: traceHeadSamplingRules (optional)
  type: array of `TraceHeadSamplingRule`
  description: Deprecated: use traceHeadSamplingRate instead. Kept for backwards compatibility with stored configurations. When traceHeadSamplingRate is absent, the effective rate is max(rate) over this list (filters are ignored).

- name: type (required)
  type: enum: `trace-reducer`
  description: Reduces trace volume by sampling CompleteSpan instances. Combines a uniform trace head sampling rate (whole-trace retention) and per-span head sampling rules with optional quantile-based tail sampling.
