What is the cost model of tracing and how do you keep it bounded?
IntermediateProductionTracing & Sampling
Answer
Cost scales with spans per second × span size × retention. A single request can produce dozens of spans. Bound it with sampling, by dropping noisy spans (health checks, Redis GET spans in hot loops) with collector filter processors, limiting attribute sizes, and using short retention (7–14 days) since traces are mainly for recent debugging.
processors:
filter/healthchecks:
traces:
span:
- 'attributes["http.route"] == "/healthz"'
More on Tracing & Sampling
In production, when do you pick tail-based over head-based trace sampling, and what does it cost you?BeginnerHow do you configure head sampling correctly in OpenTelemetry?BeginnerHow do you set up tail sampling in the OpenTelemetry Collector?IntermediateWhy does tail sampling need a load-balancing tier, and how do you build it?AdvancedHow do you combine head and tail sampling in a high-traffic system?AdvancedHow do you get accurate RED metrics if traces are sampled?Intermediate