# TraceSampler

**Type**: `object`

## Properties

- name: name (required)
  type: string

- name: sampleDurationMillis (optional)
  type: integer
  description: How long (in milliseconds) a sampled trace ID remains marked for as sampled without new messages before being declared expired. After this duration with no more events for trace, subsequent events for the same trace will be re-evaluated for sampling if seen again.

- name: sampleRate (required)
  type: number
  description: The probability (0.0 to 1.0) of sampling a newly seen trace ID.

- name: selector (optional)
  type: `EventPredicate`

- name: traceIdAttributePaths (optional)
  type: array of array of string
  description: List of attribute paths (each path is a list of segments) to extract trace IDs from. The first non-null value found will be used as the trace ID.

- name: traceIdTagKeys (optional)
  type: array of string
  description: List of tag keys to extract trace IDs from. The first non-null value found will be used as the trace ID (checked after attribute paths).

- name: traceSamplerTagKey (optional)
  type: string
  description: The key for the tag added to events of sampled traces to signal downstream operations differentiated processing.

- name: traceSamplerTagValue (optional)
  type: string
  description: The value for the tag added to events of sampled traces to signal downstream operations differentiated processing.

- name: type (required)
  type: enum: `trace-sampler`
  description: Samples traces based on their ID and marks associated events that are part of the selected traces. This can be used to bypass downstream processing such as message reduction, ensuring complete unmodified logs for those selected traces. This operation can add some overhead since it might require an additional shuffle in the pipeline. Messages that have trace IDs will be output on the "traced" output, while messages that do not have any trace IDs be output on the "untraced" output.
