Distributed tracing is a method for profiling and debugging requests as they propagate through a distributed system, such as a microservices architecture or an LLM inference pipeline. It instruments services to generate unique, correlated trace identifiers, capturing detailed timing data and metadata for each operation, known as a span. This creates a complete end-to-end visualization of a request's journey, enabling engineers to pinpoint the root cause of latency, errors, and bottlenecks across interdependent components.
Glossary
Distributed Tracing

What is Distributed Tracing?
Distributed tracing is a core observability method for tracking requests across microservices and LLM pipelines.
In the context of LLM deployment and serving, distributed tracing is critical for monitoring complex workflows involving model inference, vector database retrievals, and external API calls. By instrumenting frameworks like vLLM or Text Generation Inference (TGI), teams can observe token generation latency, KV cache efficiency, and downstream dependencies. This data feeds into Service Level Objectives (SLOs) and is essential for agentic observability, providing the deterministic telemetry needed to audit autonomous behavior and ensure reliable performance in production environments.
Key Components of a Trace
A distributed trace is a directed acyclic graph (DAG) of causally related operations. It is constructed from discrete, timestamped data points called spans, which are linked to form a complete picture of a request's journey.
Span
A span is the fundamental unit of work in a trace, representing a single, named operation within a service. It contains:
- Start and End Timestamps for latency calculation.
- A Span Name (e.g.,
handle_llm_request). - A unique Span ID.
- Attributes (key-value pairs) for contextual metadata like
model.name="gpt-4"oruser.id=12345. - Span Kind (Client, Server, Producer, Consumer, Internal).
- Status (Ok, Error).
- Links to causally related spans in other traces.
Trace
A trace is the complete end-to-end record of a transaction, comprised of a tree of spans. It is defined by:
- A globally unique Trace ID, propagated across all services involved in the request.
- A hierarchical parent-child relationship between spans, showing the flow of execution.
- The Root Span, which has no parent and represents the initial request (e.g., an API call to
/chat). - In LLM serving, a single trace can encapsulate the entire pipeline: user prompt ingestion, retrieval from a vector database, LLM inference, and final response streaming.
Context Propagation
Context Propagation is the mechanism that carries the trace context (Trace ID, Span ID, and other metadata) across service and process boundaries. This is essential for correlating spans into a coherent trace.
- W3C TraceContext is the modern standard, using HTTP headers like
traceparentandtracestate. - In asynchronous or message-based systems (e.g., Kafka, RabbitMQ), the context is injected into message headers.
- For LLMs, propagation ensures a user query's trace can follow the request through API gateways, orchestration layers, multiple model calls, and downstream tool executions.
Attributes & Events
Attributes (or Tags) are key-value pairs attached to spans that provide searchable, filterable context about the operation.
- Examples:
llm.model.vendor="openai",retrieval.top_k=5,response.token_count=1500,error.type="rate_limit".
Events (or Annotations) are timestamped logs within a span that mark a specific moment.
- Examples:
"cache.hit","generation.started","function.called: calculate_risk","exception thrown"with a stack trace. - These are critical for debugging the precise timing and cause of issues within a long-running LLM inference.
Instrumentation
Instrumentation is the code added to an application to create spans, add attributes, and propagate context. It can be:
- Automatic: Using vendor agents or frameworks (e.g., OpenTelemetry instrumentation for Python's
requestslibrary) that inject tracing without code changes. - Manual: Developers explicitly define span boundaries and attributes in business logic for maximum control and detail.
- For LLM frameworks (LangChain, LlamaIndex), instrumentation captures the execution of chains, agents, and tool calls, turning a black-box workflow into an observable graph.
Collector & Backend
The Collector is a critical intermediary service that receives, processes, batches, and exports telemetry data (spans) from instrumented applications.
- It can perform filtering, sampling, and data enrichment.
- It exports data to one or more Backends for storage and analysis.
Backend systems are where traces are stored, indexed, and visualized.
- Examples: Jaeger, Zipkin, commercial APM tools (Datadog, New Relic), or specialized LLM observability platforms.
- Here, engineers query traces, analyze service dependencies, create latency histograms, and set alerts based on trace data.
Key Tools and Standards
Comparison of major open-source and commercial distributed tracing systems, focusing on core features relevant to LLM deployment and serving.
| Feature / Metric | OpenTelemetry | Jaeger | Datadog APM | Dynatrace |
|---|---|---|---|---|
Primary Architecture | Vendor-neutral APIs, SDKs, and collector | End-to-end tracer & UI (CNCF project) | Commercial SaaS platform | Commercial AI-powered SaaS platform |
Data Collection Protocol | OTLP (gRPC/HTTP) | Jaeger's own protocols (Thrift/gRPC) | Datadog Agent & proprietary protocol | OneAgent & proprietary protocol |
Context Propagation Standards | W3C Trace Context, B3 | Jaeger (supports W3C/B3) | Datadog (proprietary, supports B3) | Dynatrace (proprietary, supports W3C) |
Auto-Instrumentation for LLM Frameworks | ||||
LLM-Specific Spans (e.g., token counts, model latency) | Custom instrumentation required | Custom instrumentation required | ||
Native Integration with Prometheus/Grafana | ||||
Tail-Based Sampling Support | ||||
Typical Hosting Cost for High Volume | Self-hosted / Variable | Self-hosted / Variable | $31-50 per host/month | $69-100 per host/month |
Frequently Asked Questions
Distributed tracing is essential for understanding the flow of requests through complex, microservices-based applications, especially when serving large language models. These questions address its core concepts, implementation, and value in an LLMOps context.
Distributed tracing is a diagnostic technique that tracks a single user request as it propagates through a distributed system of interconnected services, capturing timing data and contextual metadata to form a complete end-to-end profile. It works by instrumenting services to generate and propagate unique identifiers: a Trace ID links all operations belonging to the initial request, while Span IDs represent individual units of work within a service. As a request moves from a user interface to a model serving endpoint, through authentication, retrieval-augmented generation (RAG) lookups, and finally the LLM inference itself, each step creates a span with timing, metadata (like model name or prompt hash), and any errors. These spans are collected by a tracing backend (e.g., Jaeger, Tempo) and assembled into a visual trace, revealing the request's path, latency bottlenecks, and failure points.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Distributed tracing is a foundational component of observability for complex, microservices-based systems. These related concepts form the ecosystem of tools and practices for monitoring, debugging, and ensuring the reliability of modern applications.
Span
A span is the fundamental unit of work in distributed tracing, representing a single, named operation within a request's lifecycle. It contains timing data, a unique identifier, and metadata about the operation.
- Key attributes: Operation name, start/end timestamps, key-value tags (metadata), and references to parent/child spans.
- Example: A single database query, an HTTP call to another service, or the execution of a specific function within your LLM inference code.
- Spans are nested and linked to form a complete trace, visualizing the entire path of a request.
Trace
A trace is a directed acyclic graph (DAG) of spans that records the end-to-end path of a single request as it traverses a distributed system. It provides a holistic view of the request's journey, latency, and dependencies.
- Root Span: The initial span that starts the trace, often at the system's entry point (e.g., an API gateway).
- Causal Relationships: Child spans are causally related to parent spans, showing the flow of execution.
- Primary Use: Diagnosing where latency is introduced (the "critical path") and understanding service dependencies, which is crucial for debugging slow LLM inference chains.
Context Propagation
Context propagation is the mechanism that passes trace and span identifiers (collectively called trace context) across service boundaries, enabling the correlation of spans into a single, coherent trace.
- Carriers: The context is typically injected into and extracted from HTTP headers (e.g.,
traceparent), gRPC metadata, or message queues. - Requirements: All services in the call chain must be instrumented to participate in propagation.
- Critical for LLMs: Essential for tracing a user query through an LLM application that may call multiple external tools, databases, or other models, maintaining a single request context.
Service Mesh
A service mesh is a dedicated infrastructure layer for managing service-to-service communication in a microservices architecture. It provides built-in, transparent capabilities for traffic management, security, and—critically—observability.
- Sidecar Proxy: Services communicate via a lightweight proxy (like Envoy) deployed alongside each service instance.
- Automatic Tracing: The mesh can automatically generate spans for all inter-service traffic without requiring code changes in the application.
- Integration: Often integrates with tracing backends, providing a low-effort way to gain visibility into network-level latency and failures.
Application Performance Monitoring (APM)
Application Performance Monitoring (APM) is a suite of tools and practices for monitoring and managing the performance and availability of software applications. Distributed tracing is a core data source for modern APM platforms.
- Beyond Tracing: APM tools typically aggregate traces with metrics (e.g., error rates, request rates) and logs to provide a unified dashboard.
- Key Features: Automated performance baselining, anomaly detection, alerting, and root cause analysis.
- For LLM Ops: APM is essential for tracking LLM-specific metrics like token generation latency, prompt throughput, and cost-per-request alongside traditional application health signals.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us