The AI Observability Pattern: OpenTelemetry Tracing for LLM Calls, Token Cost Attribution, and Eval Metrics in Production (2026)


The service mesh moves cross-cutting networking concerns — mTLS, retries, timeouts, circuit breaking, traffic shaping, authorisation, and east-west observability — out of application code and into a uniform infrastructure layer. This guide covers when a mesh is worth adopting and when it is not, the data plane / control plane architecture, the leading implementations (Istio, Linkerd, Cilium Service Mesh, Consul Connect), production configuration patterns with Istio, the latency and resource cost (and how ambient mode and eBPF approaches change the calculus), and the operational practices that determine whether a mesh deployment delivers value or accumulates debt.
The classifier sits at the entrance to every well-designed AI system. The obvious implementation is to use an LLM. It works on day one. By month three, the team is paying tens of thousands per month for classification, watching tail latency drift upwards, and absorbing classifier outages every time the model provider has an incident. The hybrid classification pattern fixes this with a tiered pipeline: cheap deterministic rules handle 60-80% of traffic at near-zero cost; an embedding nearest-neighbour classifier handles 10-25% at sub-cent cost; the LLM handles only the genuinely ambiguous 5-15%. The economic effect is a 60-90% cost reduction; the architectural effect is more important — the system stops paying frontier-model latency for trivial decisions and the failure surface narrows. This article covers the three-layer pipeline, confidence-threshold tuning per category, training-data sourcing, fallback ordering, composition with Classification-First and Prompt Routing, anti-patterns, and configuration values.
The static model choice has become the most expensive architectural decision in a 2026 LLM system. The provider market now spans a 60-200x price spread end to end, the quality gap on the dominant production workload is below the noise floor of A/B telemetry, and the latency profile of frontier models has widened — not narrowed. The Model Router Pattern is the architectural answer: a routing layer that, for every inbound request, chooses the cheapest model on the provider mix whose expected quality and latency clear the workload-specific gate, with a deterministic fallback when the routing decision turns out wrong. This article specifies the three routing axes (cost, quality, latency) and why single-axis routing always degrades, the four router primitives (cascade, classifier, learned, embedding-similarity) and when each is right, the 2026 landscape (Martian, NotDiamond, RouteLLM, Bedrock Intelligent Prompt Routing, OpenRouter Auto, Portkey, LiteLLM), the four-component calibration loop, the cost math with worked per-million-token economics, eight anti-patterns, and the five-stage maturity ladder from "we picked GPT" to a router that contributes a measurable line item to gross margin.
The conventional circuit breaker was designed for a world where one service called one downstream and the failure modes were mostly availability — the dependency was up or down. AI agents inhabit a different world: an orchestrator that fans out to a heterogeneous set of tools, multiple LLM providers, and internal capabilities, each with its own failure profile, latency distribution, cost per call, and consequence on the agent's task. A single per-host breaker treats them all the same and is wrong almost everywhere. The agent-level circuit breaker pattern replaces the conventional one with a hierarchy of breakers — per-tool, per-provider, per-capability — each tuned to the failure mode it is meant to protect against. This article walks through the hierarchy in production: which dimensions need their own breakers, how thresholds should differ, what fallback semantics make sense at each layer, how to compose breakers with retries and timeouts without amplifying load, and the operational dashboards that make agent-level breakers debuggable.
Advertise and partner
Reach engineering leaders and CTOs reading about AI, mobile and cloud architecture.
Sponsored mentions and co-authored articles or technical deep-dives. Relevant products only, always disclosed.