By Sagar Shankaran, Founder of CallSphere
A guide to observability for LLM-powered applications, covering tracing frameworks, key metrics, debugging techniques, and the emerging tooling ecosystem.
Key takeaways
Traditional software observability focuses on request latency, error rates, and resource utilization. LLM-powered applications introduce entirely new dimensions that existing tools were not designed to capture: prompt content, token usage, model confidence, hallucination rates, and reasoning quality.
Without purpose-built LLM observability, debugging production issues becomes guesswork. Why did the agent give a wrong answer? Was it the prompt, the retrieved context, the model, or the tool execution? Without tracing, you cannot tell.
Every LLM call should be traced with:
trace = {
"trace_id": "abc-123",
"span_id": "span-1",
"model": "claude-sonnet-4-20250514",
"prompt_tokens": 2847,
"completion_tokens": 512,
"latency_ms": 1823,
"cost_usd": 0.012,
"temperature": 0.7,
"stop_reason": "end_turn",
"system_prompt_hash": "sha256:a1b2c3...",
"user_id": "user-456",
"session_id": "session-789"
}
For agent systems, traces must be hierarchical: the top-level agent span contains child spans for each reasoning step, tool call, and sub-agent invocation.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
Beyond operational metrics, track output quality:
LLM costs can spiral without visibility:
flowchart TD
HUB(("You Cannot Improve What<br/>You Cannot See"))
HUB --> L0["The LLM Observability Stack"]
style L0 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
HUB --> L1["The Tooling Ecosystem"]
style L1 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
HUB --> L2["Practical Debugging Patterns"]
style L2 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
HUB --> L3["What to Alert On"]
style L3 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
HUB --> L4["Build vs. Buy"]
style L4 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
style HUB fill:#4f46e5,stroke:#4338ca,color:#fff
The LLM observability market has exploded in 2025-2026:
| Tool | Focus | Key Feature |
|---|---|---|
| LangSmith | LangChain ecosystem | Deep integration with LangChain/LangGraph |
| Langfuse | Open-source tracing | Self-hostable, generous free tier |
| Arize Phoenix | ML observability | Strong evaluation and experiment tracking |
| Braintrust | Evals + logging | Powerful eval framework with logging |
| Helicone | Gateway + observability | Proxy-based, zero-code integration |
| OpenTelemetry + custom | Standard telemetry | Uses existing infra, maximum flexibility |
When a user reports a bad response, pull the trace and compare it against traces for similar queries that succeeded. Differences in retrieved context, tool call sequences, or prompt variations often reveal the root cause.
Hash your system prompts and track quality metrics by hash. When a prompt change is deployed, compare quality metrics before and after. Automated alerts on quality degradation catch regressions before users do.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
Set per-request token budgets and alert when exceeded:
MAX_TOKENS_PER_REQUEST = 50000 # Total across all LLM calls
@observe(name="agent_task")
async def handle_request(query: str):
token_counter = TokenCounter(budget=MAX_TOKENS_PER_REQUEST)
# ... agent execution ...
if token_counter.exceeded:
logger.warning(
"Token budget exceeded",
budget=MAX_TOKENS_PER_REQUEST,
actual=token_counter.total,
trace_id=current_trace_id()
)
Track user feedback signals (thumbs up/down, corrections, conversation abandonment) and correlate them with trace data. This reveals which types of queries, contexts, or model behaviors lead to poor user experiences.
For teams just starting with LLM observability, a managed tool like Langfuse or Helicone gets you 80% of the value in a day. For teams with mature observability infrastructure, extending OpenTelemetry with custom LLM spans provides maximum flexibility and avoids vendor lock-in.
The key principle: instrument from day one. Retrofitting observability into a production LLM system is significantly harder than building it in from the start.
Sources: Langfuse Documentation | OpenTelemetry Semantic Conventions for GenAI | Arize Phoenix
flowchart LR
IN(["Input prompt"])
subgraph PRE["Pre processing"]
TOK["Tokenize"]
EMB["Embed"]
end
subgraph CORE["Model Core"]
ATTN["Self attention layers"]
MLP["Feed forward layers"]
end
subgraph POST["Post processing"]
SAMP["Sampling"]
DETOK["Detokenize"]
end
OUT(["Generated text"])
IN --> TOK --> EMB --> ATTN --> MLP --> SAMP --> DETOK --> OUT
style IN fill:#f1f5f9,stroke:#64748b,color:#0f172a
style CORE fill:#ede9fe,stroke:#7c3aed,color:#1e1b4b
style OUT fill:#059669,stroke:#047857,color:#fff
flowchart TD
HUB(("You Cannot Improve What<br/>You Cannot See"))
HUB --> L0["The LLM Observability Stack"]
style L0 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
HUB --> L1["The Tooling Ecosystem"]
style L1 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
HUB --> L2["Practical Debugging Patterns"]
style L2 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
HUB --> L3["What to Alert On"]
style L3 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
HUB --> L4["Build vs. Buy"]
style L4 fill:#e0e7ff,stroke:#6366f1,color:#1e293b
style HUB fill:#4f46e5,stroke:#4338ca,color:#fff

Written by
Sagar Shankaran· Founder, CallSphere
LinkedInSagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
How to actually observe a WebSocket fleet: ping/pong heartbeats, Prometheus metrics that matter, dead-man switches, and the alerts that fire before customers notice.
Run offline evals as a CI gate. GitHub Actions wiring, threshold gates, LangSmith Experiments, and how to block merges on agent regression — with real YAML.
How the modern agent eval stack actually flows: instrument, trace, dataset, evaluator, score, CI gate. The full pipeline that keeps agents from regressing.
Tracing fundamentals for production AI agents — span hierarchy, session correlation, and the failure patterns that only show up when you trace every step.
Offline evals catch regressions before deploy on a fixed dataset. Online evals catch real-world drift on live traffic. You need both — here is how we run them.
A principal engineer's playbook for curating, versioning, and growing a golden dataset for an agent — from production trace mining to annotation queues in LangSmith.
© 2026 CallSphere Inc. All rights reserved.
Made within San Francisco