Concept
Head and tail sampling
Head sampling decides whether to keep a trace as early as possible, when the request starts, so it is cheap but cannot know which requests will fail or be slow. Tail sampling decides after the whole trace has been collected, so it can keep every error and every slow request. The price of tail sampling is a stateful collector that holds all spans in memory and must receive every span of a trace.
- Request starts
- Head: decide now (fails)
- Request runs, is slow
- Tail: decide now (succeeds)
- Slow trace kept (succeeds)
Where you'll see it
Nothing on the site names this term yet.
Related concepts
Sources: OpenTelemetry: sampling ↗ · OpenTelemetry Collector: tail sampling processor ↗ · Report a problem
The definition is in our own words.