MyObservability

🟦 Sampling

A sampler’s purpose is to lower the load (or the amount of created traces), and to reduce costs.

OpenTelemetry can perform sampling depending on the amount of traces/traffic you want to send. (ie. take only 10% of the traces).

We may pay more for more data, which leads high cost from the relevant cloud provider/vendor.

In terms of performance, the unsampled spans are being collected but not being sent, thus reducing the load of sending them in the network and some CPU/memory of the process that sends them as a result.

We only need some of traces (most of the time) are enough to understand patterns in services and gain better insights.

Types:

🟥 Head-based sampling

Decide you want to sample or not upfront, at the beginning of the trace.

🟥 Tail-based sampling

Decide to sample at the end of the entire flow, when we already gathered the data. This type of sampling is done at the collector.

🟩 OpenTelemetry Samplers

You can implement sampling is through “Samplers”.


✅ Main Page: Click Here