Course contentsShow
← System Design
Lesson 1257 of 1,91931. Observability: TracingFree lesson

Storage and Retention Costs

Trace data volume grows with traffic and cardinality; balancing retention periods against storage expenses.

Storage and Retention Costs

What you'll learn: How trace data volume scales with traffic and why balancing retention periods against storage costs is critical.

The Volume Challenge

Distributed tracing generates enormous amounts of data. Every request creates a trace with multiple spans—if you serve 1,000 requests per second across 10 services, that's potentially 10,000+ spans per second. At scale, this becomes millions of spans daily.

Unlike metrics (which aggregate) or logs (which you can filter aggressively), traces are inherently high-cardinality and span-heavy. Each unique request path, each tag combination, each span attribute adds storage burden.

The Cost Equation

Storage costs compound from two factors:

Volume = Traffic × Services × Spans per Service × Attributes per Span
Cost = Volume × Retention Period × Storage Price

If you retain 30 days of traces at full sampling, you're storing 30× more data than a 1-day retention window. Cloud storage pricing makes this expensive fast—especially when querying historical traces requires hot storage tiers.

Balancing Act

This is why sampling strategies (head-based, tail-based, adaptive, priority) exist—they reduce ingested volume. But you also need smart retention policies:

  • Keep high-value traces (errors, slow requests) longer
  • Age out normal traces aggressively
  • Use cold storage for compliance-only retention
  • Monitor your storage growth rate weekly

Think of traces like security camera footage: you can't store 4K video forever from every camera. You sample frame rates, compress, and archive strategically.

Key Takeaway: Trace storage costs scale with traffic and cardinality; effective cost management requires combining sampling strategies, tiered retention policies, and continuous monitoring of data growth.