Sampling
Definition
Sampling records a subset of telemetry; head sampling decides at the start of a trace, tail sampling decides after the trace completes, and log sampling drops a share of repetitive log lines.
In practice
At thousands of requests per second, keeping every span or debug log is expensive. Head sampling is cheap and consistent (keep 5% of trace ids at the root, propagated through the flags) but blind to the outcome, so most rare errors are lost. Tail sampling buffers whole traces in a collector and keeps all errors and slow traces plus a small share of normal ones.
Tail sampling needs every span of a trace to reach the same collector, so large deployments route by trace id from agents to a gateway tier, which costs memory and adds a moving part. Sampled data cannot give counts or rates, so derive those from metrics. For logs, keep every error and sample the successes.
Example
A Collector tail-sampling policy keeps 100% of traces with an error status, 100% slower than 2 s, and 2% of the rest, cutting stored spans by about 95%.