Protocols & Advanced Techniques

OpenTelemetry for AI

Production-Grade Observability for Every LLM Call, Agent Step, and Token

Architecture diagram coming soonCustom visual for this concept is in development

In a Nutshell

OpenTelemetry for AI extends the CNCF's open observability standard with semantic conventions for generative AI workloads — standardizing how LLM calls, token usage, agent steps, and vector queries are traced and measured across any model provider or framework. For the enterprise, it means AI system observability that plugs into the same monitoring infrastructure already used for the rest of your application stack.

The Concept, Explained

Enterprise AI systems are black boxes without proper observability. When a multi-step agent workflow fails or produces a poor response, engineers need to know exactly which LLM call returned unexpected output, how many tokens were consumed, how long each retrieval step took, and whether a guardrail was triggered. OpenTelemetry's AI semantic conventions define a vendor-neutral schema for capturing this telemetry — the same spans, attributes, and metrics regardless of whether the model is GPT-4o, Claude, or Llama running on your own infrastructure.

The semantic conventions for generative AI define standard span attributes including: model name and version, input/output token counts, finish reason, temperature and sampling parameters, embedding model details, and vector store query metrics. This standardization means a single Grafana dashboard or Datadog trace view can display detailed AI telemetry from a polyglot AI stack — no vendor-specific SDKs required for each model provider.

For complex agentic workflows, OpenTelemetry trace propagation carries context across every LLM call, tool invocation, and sub-agent delegation in a single distributed trace. Operations teams gain end-to-end latency visibility, can identify which agent step accounts for 80% of latency or cost, and can correlate AI performance anomalies with business outcomes. This is the foundation for SLA management on AI-powered features — treating AI calls with the same operational rigor as any other production service.

The Toolchain in Focus

TypeTools
Instrumentation Libraries
Observability Backends
AI-Specific Observability

Enterprise Considerations

Unified Observability Stack: The primary enterprise benefit of OTel for AI is consolidation — AI telemetry flows into the same Datadog, Grafana, or Splunk instance as your application and infrastructure metrics. This eliminates the need for a separate AI observability silo and enables correlation between AI system behavior and application performance metrics in a single pane of glass.

Token & Cost Attribution: OpenTelemetry span attributes for token counts enable precise cost attribution at the request, feature, team, or customer level. Instrument your AI calls with custom span attributes that carry business context (team ID, feature name, customer tier) to build cost allocation reports directly from your existing observability infrastructure.

Data Privacy in Traces: By default, OTel instrumentation may capture prompt and completion text in span attributes — a significant data privacy risk for AI systems processing PII or sensitive business information. Configure all AI instrumentation to redact or hash prompt content before export, or restrict trace export to internal-only backends with appropriate access controls.

Related Tools

OpenTelemetryLLM ObservabilityAI MonitoringDistributed TracingLLMOpsToken TrackingGenAI Ops
Share: