DEV Community

Adam Gardner
Adam Gardner

Posted on

OpenTelemetry Sampling: Everything you need to know about Head and Tail Sampling

There are two types of sampling in OpenTelemetry: Head and Tail sampling.

Head Sampling happens at the earliest possible opportunity (in the code) and it happens to the very first span on the trace (the root span).

Tail Sampling happens at the very latest opportunity (and thus usually in the collector)

The two are equally powerful, have different uses, applications, benefits and drawbacks. You should, and probably will, end up using them both.

In this video, I explain everything you need to know and give 12 examples + YAML files for how you can use tail sampling:

Top comments (0)