
Datadog Agent Observability: Tracing AI Costs to the Agent
Enterprise Developer PlatformsA provider bill that grew 40% on 40% more traffic is a different problem from one that grew 40% on flat traffic, and the bill alone can’t tell them apart. Datadog’s Agent Observability now ties estimated AI cost to the applications, traces and spans that produced it. For platform teams fielding “why did our LLM bill jump?” from finance, the useful part is that it names avoidable spend, such as an uncached prompt prefix, and estimates what fixing it would save.
What Happened
Datadog’s announcement describes three layers in Agent Observability:
- Cost page: total spend with period-over-period change, broken down by application, provider or custom tags such as team, feature and environment, plus cost per request, cache hit ratio and cache reuse ratio.
- Most Expensive LLM Calls: ranks calls by estimated cost and opens the trace, where each span shows the cost and tokens of a specific LLM call, tool, retrieval step or handoff.
- Cost Savings Opportunities: analyzes observed behavior for avoidable spend and ranks recommendations by application and estimated financial impact.
Why It Matters
Datadog’s argument is that agent cost depends on architecture, not just model choice: how many turns a loop runs, how many tools it calls, how much retrieved context it carries and how much of that is re-sent every turn. Provider bills are keyed to API keys and models, so a rise could mean more traffic, a model change, poor prompt-cache use, an agent loop or a change anywhere in a workflow.
Grouping cost by model, token type, environment, service or version tests each explanation. A token-type split shows whether the increase came from uncached input, cached input, cache writes, reasoning or output. A version split can tie a change in cost or caching to a deployment. Datadog also notes that a lower-volume app with high cost per trace or little cache reuse may be the cheaper fix and the bigger win than the agent with the largest bill.
The savings recommendations target request structure. Datadog lists examples it can detect:
- An application not using prompt caching at all
- Dynamic content that keeps changing a reusable prompt prefix
- Inconsistent message formatting that prevents cache hits
- Tool definitions that change between calls
- Conversation history re-sent in full on every turn
Each insight shows observed spend, the recoverable percentage, the current cache hit ratio and a target, for example moving from 0% toward 55% or 80%. A “How we found this” view exposes sample size, period, filters and limitations, and engineers can hand the fix to Bits or copy an agent prompt.
What This Means for Platform Teams
Datadog cautions that a cost optimization can change application behavior, so it pairs the cost data with evaluations and Agent Observability Experiments to compare baseline and proposed changes on the same dataset. Stack Archive covered how Datadog cut its own AI spend by over $1 million a month by migrating models, adjusting effort levels and optimizing context.
The So What
Platform teams running production agents on Datadog should tag LLM traffic by team, feature and environment first, so the Cost page can break spend down along those lines. Then review the cache hit ratio for each application and start with Cost Savings Opportunities on low-volume, high-cost-per-trace apps. Validate each prompt restructuring with an experiment before shipping it.
Source: Datadog Blog
Content created with AI assistance and reviewed for accuracy.
Join the conversation
Stack Insiders is our free community for readers who want to go deeper — share resources, ask questions, and connect with others across every vertical we cover.
Join Stack Insiders →