The ideal audience to review and implement this material includes:
Senior Site Reliability Engineers (SREs): To oversee the integration of tracing into production pipelines and manage OTel collectors.
AI/ML Engineers: To ensure model-specific metadata (tokens, prompt templates, tool calls) are captured for performance evaluation.
Lead Software Architects: To standardize semantic conventions and distributed tracing across microservice boundaries.
Abstract
This technical enablement session provides a comprehensive blueprint for implementing OpenTelemetry (OTel) and OpenInference to achieve observability in AI-driven applications. The presentation transitions from the foundational theory of distributed tracing—defining spans, traces, and sessions—to the granular configuration of OTel components, including resources, exporters, span processors, and tracer providers.
A significant portion of the session focuses on the practicalities of instrumenting LLM workflows, highlighting the trade-offs between auto-instrumentation (via monkey-patching) and manual instrumentation for high-fidelity data. Advanced architectural concerns are addressed, such as context propagation across service boundaries, tail sampling strategies to manage telemetry costs without losing critical error data, and the deployment of OTel Collectors for PII redaction and multi-backend data fan-out. The session concludes with specific "gotchas" regarding data loss in ephemeral environments like AWS Lambda and the necessity of adhering to OpenInference semantic conventions for effective UI visualization and evaluation.
Ultimate OpenTelemetry Guide for Tracing AI Applications
0:49 The Observability Imperative: Observability is framed as a mechanism for maintaining user trust by surfacing "silent failures," such as degraded LLM outputs and partial outages, which standard monitoring often misses in complex, distributed AI systems.
4:07 OTel Architecture Fundamentals: OpenTelemetry is defined as a vendor-neutral, language-agnostic framework for generating and exporting telemetry (traces, metrics, logs). It is emphasized that OTel is a collection toolkit, not a storage backend or visualization layer.
Resource: Immutable metadata describing the entity (e.g., service name, environment).
Tracer Provider: The central factory for creating tracers; must be configured globally.
Span Processor: Logic that handles spans post-creation (Batch for production; Simple for development).
21:48 Exporter Protocols (gRPC vs. HTTP): OTLP via gRPC (Port 4317) is recommended for high-throughput production due to its compact binary Protobuf format. HTTP/JSON (Port 4318) is preferred for debugging or bypassing restrictive corporate proxies.
35:05 Shutdown and Flush Mechanics: A critical takeaway for serverless (AWS Lambda) and Node.js environments: failure to call force_flush() or shutdown() before process termination will lead to the loss of the final batch of telemetry data.
39:30 Arize Routing Processor: Introduction of a custom processor that allows a single application to route traces to different projects or spaces by overriding the immutable resource attributes using the arise.prov.name span attribute.
41:26 OpenInference Semantic Conventions: Standardized naming (e.g., openinference.span.kind) is essential for interoperability and ensuring the UI correctly renders LLM inputs, outputs, and tool parameters.
Auto-instrumentation: Uses monkey-patching to wrap library functions (OpenAI, LangChain) for zero-effort tracing.
Manual/Hybrid: Provides full control over span attributes but requires manual lifecycle management (Start/End) to avoid "orphan spans."
53:47 Custom Span Processors for PII: Demonstrates using the on_end method to intercept and redact Personally Identifiable Information (PII) using regex before the data is serialized and exported.
57:26 Manual Context Propagation: Explains how to pass TraceID and SpanID across thread boundaries and network hops using the Context API (attach/detach) and Propagators (inject/extract) to prevent broken traces in microservices.
1:05:33 Sampling Strategies:Head Sampling (early decision) is efficient for cost control, while Tail Sampling (post-completion decision) allows for keeping 100% of error or high-latency traces at the cost of higher infrastructure overhead.
1:12:43 OTel Collector Deployment: Collectors act as a proxy for filtering, transforming, and fanning out data. They should be deployed as a sidecar or gateway to offload processing from the main application.