Skip to content
TrustHappens

Trace Sampling Is a Business Decision, Not a Config Default

Why the trace sampling rate is a cost and risk trade-off that engineering leadership should own explicitly, instead of a number inherited from an SDK default.

TrustHappens Editorial TeamPublished 6 min read
Illustration for Observability & Cloud

The argument

Trace sampling decides which incidents you will be able to explain and what you will pay to explain them. That makes it a cost and risk decision for engineering leadership, written down and reviewed, not a default left in a configuration file.

This is a analysis piece. It argues a point of view: opinions are marked as ours, and factual claims are cited in the sources below.

Written by

TrustHappens Editorial Team

The TrustHappens editorial team writes and reviews every piece against primary sources: official documentation, standards bodies and regulators. We are the team behind aiAxonIQ, TrustIvan, TrustLynce, MithunAI and ARUKZ ERP, and we disclose that wherever our products appear.

On this page

Ask an engineering leader what their error budget is and you will usually get a number and a reason. Ask what fraction of production traces they keep, and why, and the answer is often a shrug, a link to a Helm chart, or "whatever the vendor recommended". That gap is the subject of this piece.

The argument

Sampling is the decision about which requests leave evidence behind. Every trace you drop is a request you cannot reconstruct later. Every trace you keep costs money to transport, store and query. Somewhere between "keep everything" and "keep almost nothing" sits a rate, or a set of rules, that determines two things a business cares about: how much observability costs, and which failures you will be able to explain to a customer, an auditor or your own incident review.

Decisions with that shape, a spend line traded against a risk, normally have an owner, a written rationale and a review date. Sampling rarely does. It tends to be set once, by whoever wired up the first SDK or collector, and then inherited by every team that copies the configuration.

The evidence

The facts below come from the OpenTelemetry project, the W3C and Google's published work on tracing. The interpretation that follows them is ours.

Sampling is a deliberate trade-off, by design. Google's Dapper paper, which shaped most modern tracing systems, names the use of sampling as one of the design choices that were key to the system's success, alongside its goals of low overhead and ubiquitous deployment. Sampling was never an accident of tooling; it was a conscious cost decision made by the people running the system.

The defaults do not encode your priorities. The OpenTelemetry SDK specification sets the default OTEL_TRACES_SAMPLER to parentbased_always_on: follow the parent's decision, and sample root spans. Many teams then add a ratio sampler, or a vendor agent applies its own, and the effective policy becomes whatever sits at the end of that chain. W3C Trace Context carries the sampled decision in the trace-flags field, and the specification itself describes those flags as recommendations from the caller rather than strict rules, citing trust and abuse, bugs in the caller, and different load between services. A sampling decision therefore travels across team boundaries and can be overridden along the way.

Head sampling cannot see outcomes. The OpenTelemetry sampling documentation explains that head sampling decides as early as possible, without inspecting the whole trace. Its primary downside, in the project's words, is that you cannot ensure that all traces with an error are sampled using head sampling alone. A probabilistic rate set before the request runs cannot know which requests will matter.

Tail sampling sees outcomes but costs engineering effort. Tail sampling decides after most of a trace has arrived, so it can keep every error or every slow trace. The same documentation lists three downsides: it can be difficult to implement, because rules change as systems change; difficult to operate, because tail samplers are stateful systems that may need many compute nodes and must be monitored; and often vendor-specific. The Collector's tail sampling processor documentation adds an operational detail: traces wait in memory for decision_wait, bounded by num_traces, and a trace evicted from that buffer before the decision is dropped without being sampled. Raising either setting increases memory use, and all spans for a trace must reach the same collector instance.

The project itself frames sampling around budget and data shape. OpenTelemetry's guidance on when to sample points to high trace volume, mostly healthy traffic, clear criteria for what matters, and "your overall budget" as the reasons to do it. That is a cost-benefit framing, not a technical constant.

Reliability practice already has a model for owned trade-offs. The Google SRE Workbook describes error budget policies that set out in advance what happens when a service exhausts its budget, such as pausing feature launches, and uses the share of budget an incident consumed to decide which incidents merit closer investigation. Explaining an incident depends on having the evidence for it.

Counterpoints

The strongest case against our view deserves a fair hearing.

"This is an implementation detail; leadership has better things to do." Sampling rules are technical, they change with traffic, and a VP of Engineering is not going to review collector YAML. Pushing the decision upward could slow down the platform team and produce policy that is out of date by the time it is approved.

"Low sampling rates work fine at scale." The Dapper paper reports more than two years of production use with sampling, and measures success by usefulness to developer and operations teams. For high-volume, homogeneous traffic, a small fraction of traces still yields a statistically meaningful picture of latency and dependency structure, and metrics catch what traces miss.

"Metrics and logs cover the gap." Many incidents are detected from metrics and diagnosed from logs, with traces as a convenience. Spending heavily on trace retention may buy little.

These points are partly right. Leadership should not tune rules, low rates can be statistically sound for aggregate questions, and traces are not the only signal. Our disagreement is narrower: aggregate questions and incident questions are different. A small sample is good evidence for "what does p99 latency look like?" and poor evidence for "what happened to this customer's failed payment at 14:02?" Which of those questions your business must be able to answer is exactly the part that should not be decided by default.

What this means in practice

Treating sampling as a business decision does not mean a committee. It means the same light structure you already use for SLOs.

  • Name an owner. One person, usually the head of platform or SRE, owns the sampling policy and can explain it.
  • Write the policy in outcome terms. Instead of "10% probabilistic", write "keep every trace with an error or above the latency SLO threshold for checkout and login; keep a ratio of healthy traffic sufficient for latency analysis; keep all traces for services under active incident". The rate follows from the outcomes.
  • Attach the cost. Put the monthly telemetry spend for traces next to the policy, so the trade-off is visible when someone proposes changing it.
  • Review it with the error budget. When an incident review finds the needed trace was dropped, record that as a finding against the sampling policy, just as you would a missing alert.
  • Decide where sampling happens. Head sampling in SDKs, tail sampling in a collector tier, or retention policy in the backend each move cost and operational burden to a different team. Choose deliberately.

Some teams decide the cleanest policy is to keep what they send and control cost through what they instrument and how long they retain it, rather than through probabilistic dropping. That is a legitimate choice if the spend is understood and accepted. aiAxonIQ, built by the team behind TrustHappens, is designed around that model: it is OpenTelemetry-native and keeps the spans you send rather than sampling them away.

Whichever platform you use, the point stands: the policy should be a decision someone made on purpose. Our guide to OpenTelemetry covers where samplers sit in the pipeline, and logs, metrics and traces explained covers what each signal can and cannot tell you during an incident.

Recommendations

  1. Inventory your effective sampling today. For each service, record the SDK sampler, any collector processors and any backend retention rules. The effective rate is the product of all of them, and few teams know it.
  2. List the incident questions you must be able to answer. Customer disputes, security investigations, regulated transactions and post-incident reviews each imply traces you cannot afford to lose. Make those always-keep rules.
  3. Use head sampling only for traffic you are content to analyse in aggregate. High-volume, healthy, homogeneous traffic is the right place for ratios.
  4. If you run tail sampling, monitor it like production. Track dropped-too-early traces and decision latency; a tail sampler that silently drops traces under load is a policy failure.
  5. Put the policy on a review calendar. Revisit it quarterly or after any incident where evidence was missing, and record who approved the change.
  6. Use a checklist for the rollout. The observability implementation checklist includes sampling and retention as explicit line items with owners.

Sampling will always involve dropping something. The question is whether you chose what to drop.

Sources and references

  1. OpenTelemetry: Sampling concepts
  2. OpenTelemetry specification: SDK environment variables
  3. OpenTelemetry Collector Contrib: Tail Sampling Processor
  4. W3C Trace Context (Recommendation)
  5. Sigelman et al., Dapper, a Large-Scale Distributed Systems Tracing Infrastructure (Google, 2010)
  6. Google SRE Workbook: Implementing SLOs

Share this analysis

Written by

TrustHappens Editorial Team

The TrustHappens editorial team writes and reviews every piece against primary sources: official documentation, standards bodies and regulators. We are the team behind aiAxonIQ, TrustIvan, TrustLynce, MithunAI and ARUKZ ERP, and we disclose that wherever our products appear.

  • Building and operating observability, security, compliance, AI and manufacturing ERP software
  • Reviewing content against official documentation before publication
Illustration for Observability & Cloud
Industry reportObservability & Cloud

Enterprise Observability Outlook

Where enterprise observability is heading: OpenTelemetry maturity by signal, cost pressure, consolidation, profiling, LLM telemetry, AI-assisted investigation and SLOs.

· 10 min read

Stay Ahead of What Matters.

Practical guides on observability & cloud and more, delivered to your inbox.