Prompt

I’m building an app with dozens of services how should traces be stored

Technology / Observability1 observationLast seen Oct 28, 2026

Latest observation

Oct 28, 2026OpenAI APIWeb search: off

For an app with dozens of services, don’t store traces in each service. Centralize them in a distributed tracing backend and treat services as trace producers only.

Recommended approach

1) Use a standard trace format

Instrument every service with OpenTelemetry and propagate context across service boundaries using:

  • trace_id
  • span_id
  • W3C Trace Context headers (traceparent, tracestate)

This makes traces correlate cleanly across all services.

2) Send traces to a collector, not directly to storage

Each service should export spans to an OpenTelemetry Collector or similar agent/sidecar.

Flow:

  • Service emits spans
  • Collector receives, batches, filters, samples, enriches
  • Collector forwards to trace storage backend

This reduces load on app services and gives you a control point for sampling and processing.

3) Store traces in a backend designed for high-cardinality time-series

Use a tracing system like:

  • Jaeger
  • Grafana Tempo
  • Zipkin
  • Datadog / New Relic / Honeycomb if using SaaS

Backend choice depends on scale and retention needs.

4) Partition storage by trace ID and time

Traces are usually queried by:

  • trace ID
  • service name
  • operation name
  • time range
  • error status

A good backend indexes metadata lightly and stores the full span data in cheaper object storage or an optimized column store.

Common pattern:

  • Hot index for recent searchable metadata
  • Cold object storage for full trace bodies
  • Optional downsampling for old traces

5) Keep retention policy strict

Do not keep all traces forever. Set:

  • short retention for full-fidelity traces, e.g. 3–30 days
  • longer retention for sampled/aggregated metrics
  • higher sampling on success paths, lower on noisy internal requests

6) Sample intelligently

With dozens of services, storing every trace can get expensive fast. Use:

  • head sampling for baseline cost control
  • tail sampling to keep error/slow traces
  • adaptive sampling for high-volume endpoints

A common strategy:

  • 100% of errors
  • 100% of slow traces
  • 1–10% of normal traffic

Practical storage model

A typical span record includes:

  • trace ID
  • span ID
  • parent span ID
  • service name
  • operation name
  • start timestamp
  • duration
  • status/error
  • attributes/tags
  • events/log links
  • resource metadata

Store spans as append-only records. Reconstruct traces by grouping spans with the same trace ID.

What not to do

  • Don’t write trace data into the primary application database
  • Don’t store traces only in logs
  • Don’t let every service manage its own trace store
  • Don’t keep unlimited full-fidelity traces

If you want a simple default architecture

Use:

  • OpenTelemetry in every service
  • OpenTelemetry Collector
  • Grafana Tempo or Jaeger
  • Object storage + short-lived index
  • Tail sampling for errors/slow requests

If you want, I can also give you:

  1. a reference architecture diagram,
  2. a schema for storing spans, or
  3. a recommended setup for Kubernetes / AWS / GCP.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.