Observability Platform · View 16 of 25 · Runtime
Decisions
- Head sampling is kept as a floor for volume control; tail sampling does the evidence selection. Two mechanisms, two purposes, declared separately.
- A trace kept by the tail sampler is kept whole. Trace affinity is achieved by consistent hashing on trace id before the sampler, because a half-trace is worse than no trace.
- Keep rules carry a per-service ceiling. Without it, "always keep errors" is an unbounded ingest path that fires hardest exactly during an incident.
What the hold window costs
- 45 seconds of in-flight spans held in memory, sized against a 5× burst. That is the entire price of tail sampling, and it is why trace freshness carries 45 s that the metric path does not (p95 ≤ 75 s to queryable).
- The assumption behind 45 s is that it covers p99.9 of in-house request duration. If long-running requests are common, either the window grows or their traces are systematically incomplete.
Risks
- The sampler is the only memory-bound, effectively stateful tier in the ingest path, and the one component whose capacity must be sized against the worst burst rather than the average.
- Dynamic rarity-based sampling makes the effective rate vary by key. Every derived count must read the stamped rate, and any consumer that forgets is wrong in a way that looks plausible.