
LLM Cost Monitoring: Account for Cached Tokens
How to handle cached tokens in LLM cost monitoring: OpenAI and Gemini count cache hits inside input, Anthropic reports them separately. Normalize before pricing.
Guides from the telemetry.dev team on tracing and debugging AI agents in production.

How to handle cached tokens in LLM cost monitoring: OpenAI and Gemini count cache hits inside input, Anthropic reports them separately. Normalize before pricing.

Span-summed token totals higher than your invoice? Pick one accounting layer, count billable attempts instead of spans, and run an offline check on your gateway traces.

Instrument a streamed LLM response with plain OpenTelemetry: first meaningful output, last output, and completed, cancelled or failed end states.

LLM tracing retrieval guide: instrument a RAG request as three sibling spans in Python so you can tell vector store time from reranker and model-call time.

Agent runs or child spans missing from your traces? Learn how LLM trace sampling, parent-based decisions, tail sampling and exporters each drop data, and how to find which.

Generative AI monitoring breaks at the queue. Learn to carry trace context from enqueue to worker, measure queue wait, and choose parent vs span links for retries.

LLM tracing breaks in async code when spans are created but never made active. Fix orphaned, flat and cross-request spans in JavaScript and Python, then assert it.

Prove your OpenTelemetry LLM observability setup works: send one synthetic model call and tool step through a Collector debug exporter, then confirm backend ingestion.

AI agent monitoring starts with run-level success rate and p50/p95 duration. Define success in your app, pick denominators, then drill into traces to find the slow step.

AI API middleware explained for small TypeScript and Python teams: how it differs from an AI gateway and an observability backend, and how to trace each boundary.

Agent telemetry for production AI agents: an OpenTelemetry span hierarchy that separates a failed attempt from a failed run, with a retry wrapper example.

AI cost observability for small teams: join reported token usage to traced calls and agent runs, and keep tokens, estimated cost and invoice as separate numbers.