Skip to content
All concepts

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.

  1. Request starts
  2. Head: decide now (fails)
  3. Request runs, is slow
  4. Tail: decide now (succeeds)
  5. Slow trace kept (succeeds)
The two differ only in when the decision is made, and that decides what it can be based on.

Where you'll see it

Nothing on the site names this term yet.