Files
mtusi2026lab7/infra/otel/traces-tail.yaml
T

40 lines
1.6 KiB
YAML

# Overlay for collector.yaml: TAIL sampling of traces (track 1 "balanced" configuration,
# docs/TRACK1.md). The decision is taken per trace after decision_wait, when its spans are in:
# keep ALL traces with an error span (status ERROR: HTTP 5xx, failed/retried job, S3/DB error),
# keep ALL slow traces (root to last span >= 250 ms),
# keep 10 % of the rest (probabilistic, by trace id: the same trace -> the same decision).
# Head sampling in the SDK (OTEL_TRACES_SAMPLER_ARG) decides at the first span and cannot know
# whether the request will fail or be slow; tail sampling can, at the price of buffering spans
# in the Collector (num_traces x spans) for decision_wait.
#
# A job is processed seconds after its upload: those spans may arrive after the upload trace was
# decided. decision_cache remembers the decision per trace id, so late spans of a kept trace are
# kept, and late spans of a dropped one are dropped (unless they are errors/slow by themselves:
# then they form a partial trace - a documented limit of the approach).
processors:
tail_sampling:
decision_wait: 5s
num_traces: 20000
expected_new_traces_per_sec: 200
decision_cache:
sampled_cache_size: 100000
non_sampled_cache_size: 100000
policies:
- name: errors
type: status_code
status_code:
status_codes: [ERROR]
- name: slow
type: latency
latency:
threshold_ms: 250
- name: baseline
type: probabilistic
probabilistic:
sampling_percentage: 10
service:
pipelines:
traces:
processors: [memory_limiter, tail_sampling, batch]