How does Grafana Tempo store traces, and what is TraceQL?

IntermediateConceptTracing & OpenTelemetry
Answer

Tempo writes traces into blocks in object storage using an Apache Parquet columnar format. There is no expensive per-tag index; the distributor hashes by trace ID, ingesters build blocks, the compactor merges them, and queriers scan columns in parallel. Lookup by trace ID is cheap; search scans only the columns needed.

TraceQL queries spans by their properties and structure:

{ resource.service.name = "checkout" && span.http.response.status_code >= 500 }
{ duration > 2s && span.db.system = "postgresql" }
{ resource.service.name = "frontend" } >> { resource.service.name = "payments" && status = error }
{ resource.service.name = "api" } | rate() by (span.http.route)

>> means "descendant of". The last line is a TraceQL metrics query, which computes rates from spans on the fly.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Tracing & OpenTelemetry