---
title: How much does storing AI agent traces cost?
url: https://opencontroller.lyzr.com/blog/cost-of-storing-ai-agent-traces
published: 2026-11-18
updated: 2026-11-18
author: Lyzr
---

# How much does storing AI agent traces cost?

**Trace volume is runs per day × spans per run × average span size × retention days. For agents, prompt and response payloads make up most of that size, so the cost question is less about raw storage and more about how much you send to an indexed, per-GB-priced observability tool.** Keep metadata indexed, move payloads to cheap object storage, and sample only where your evidence rules allow it.

## What is the formula?

**Stored volume = runs/day × spans/run × bytes/span × retention days**

**Monthly cost = stored volume × storage price + monthly ingest volume × ingest price + query costs**

Three things make agent traces heavier than ordinary service traces:

1. **Payloads.** If full prompts, retrieved context and completions are recorded on LLM spans, each one can be tens of kilobytes.
2. **Fan-out.** One agent run can create many spans: planning, each model call, each tool call, retrieval, guardrail checks.
3. **Long conversations.** Multi-turn agents resend history, so later spans carry more text than earlier ones.

## A worked example

All inputs are **illustrative assumptions**. Replace them with your own measurements.

| Input | Assumption |
|---|---|
| Agent runs per day | 50,000 |
| Spans per run | 20 (6 LLM calls, 14 tool, retrieval and logic spans) |
| Metadata per span | 2 KB |
| Payload per LLM span | 30 KB (prompt plus completion) |
| Retention | 90 days |

Per run: 20 × 2 KB of metadata (40 KB) + 6 × 30 KB of payload (180 KB) = **220 KB**.

| Measure | Result |
|---|---|
| Per day | 50,000 × 220 KB = **11 GB** |
| Per 30-day month | **330 GB** ingested |
| Stored at steady state (90 days) | **990 GB**, about 1 TB |
| Stored at steady state (1 year) | about 4 TB |

Payloads are 82% of the volume (180 of 220 KB per run).

At Amazon S3 Standard's list price of $0.023 per GB-month (US East, first 50 TB), 990 GB costs about **$23 per month** to keep. Raw storage is cheap. The expensive part is usually ingesting and indexing the same data in an observability platform priced per GB ingested or per span, and paying to query it. Check your vendor's pricing with these volumes; the gap can be large.

## How do you cut trace cost without losing evidence?

### 1. Tier the payloads

Store span metadata (IDs, agent, version, model, tool, tokens, latency, status, policy decision) in the trace backend. Store payloads in object storage, keyed by span ID, and keep only a pointer on the span. In the example, indexed volume falls from 11 GB to 2 GB per day.

### 2. Sample with rules, not at random

Use tail-based sampling, which decides after a trace completes. The OpenTelemetry Collector's tail sampling processor supports policies on status, latency and attributes. Typical rules:

1. Keep 100% of traces with errors, guardrail hits, policy blocks or human escalations.
2. Keep 100% for agents in regulated processes.
3. Keep a fixed percentage of successful, low-risk runs.

### 3. Redact before you store

Remove secrets and unneeded personal data at collection time. It reduces size and privacy exposure at once. See [LLM gateway request logging and privacy](/blog/llm-gateway-request-logging-and-privacy).

### 4. Set retention by purpose

| Data | Purpose | Typical tier |
|---|---|---|
| Full traces with payloads | Debugging, evals | Hot, short (days to weeks) |
| Span metadata | Operations, cost, trends | Indexed, medium (months) |
| Audit records of actions | Evidence, investigations | Immutable archive, as long as your record rules require |

Retention for audit records is set by legal and regulatory duties, not by cost. Our guide on [whether AI agent conversations are business records](/blog/are-ai-agent-conversations-business-records) covers that question.

### 5. Separate audit logs from traces

Audit logs need every action, never sampled. Traces are for engineering and can be sampled. Treat them as two streams with different rules. The [AI agent audit log fields](/blog/ai-agent-audit-log-fields) guide lists what audit records should hold.

## What should you measure first?

Before choosing a tool, measure for one week:

1. Spans per run, by agent.
2. Median and 95th percentile span size, with and without payloads.
3. Share of runs with errors or policy events.
4. Which fields engineers actually query.

That data tells you how much can safely move to object storage and how much sampling you can apply. For exporting traces in a standard format, see [exporting AI agent traces with OpenTelemetry](/blog/export-ai-agent-traces-with-opentelemetry). For how traces fit with other controls, see [what an AI agent control plane is](/blog/what-is-an-ai-agent-control-plane).

## How Opencontroller does this

Opencontroller is built on open standards including OpenTelemetry, so traces can be exported to the backend and storage tiers you already pay for. Its LLM judges score production traffic, and cost is attributed per agent and per version through the LLM Gateway, which helps decide which agents need full-fidelity traces. Deployment can be on Lyzr SaaS or customer-controlled infrastructure. [Book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Why are AI agent traces so large?**
Mostly because of payloads. Prompts, retrieved context and completions on LLM spans can be many times larger than the span metadata.

**Can we sample agent traces?**
For engineering traces, yes, with rules that keep all errors and policy events. Audit records of agent actions should not be sampled.

**Is storage or ingest the bigger cost?**
Usually ingest and indexing. Object storage for a terabyte of traces costs tens of dollars a month at list price; per-GB ingest pricing in observability tools is typically far higher.

## Key facts

AI agent trace volume = runs/day x spans/run x bytes/span x retention days. Payloads (prompts, context, completions) dominate: in an illustrative 50,000 runs/day, 20 spans/run example with 30 KB payloads on 6 LLM spans, runs are 220 KB each, 11 GB/day, about 1 TB at 90-day retention, with 82% of volume in payloads. At S3 Standard list price ($0.023/GB-month) that storage costs about $23/month; ingest and indexing in observability tools is usually the larger cost. Levers: tier payloads to object storage, tail-based sampling that keeps all errors and policy events, redaction, purpose-based retention, and separate unsampled audit logs.

## Related

- [How do you export AI agent traces with OpenTelemetry?](https://opencontroller.lyzr.com/blog/export-ai-agent-traces-with-opentelemetry.md)
- [What should an LLM gateway log, and what should it never store?](https://opencontroller.lyzr.com/blog/llm-gateway-request-logging-and-privacy.md)
- [What should an AI agent audit log contain?](https://opencontroller.lyzr.com/blog/ai-agent-audit-log-fields.md)
- [More on Gateways and cost](https://opencontroller.lyzr.com/blog/cluster/gateways-and-cost)
