Span
A span is a record of an individual operation within a trace, including its timing, contextual information, and relationships to other operations.
Designing AI Systems
A span is a distributed-tracing record representing one timed operation within a trace and its relationship to parent and child operations.
- How it is used
- Represents timed service operations so distributed traces can reconstruct requests and expose bottlenecks.
- How deep it goes
- Defines span fields and parent-child relationships, then implements instrumentation, context propagation, buffering, and ingestion.
- Examples
- Uses a patient intake trace and a custom reranking span to illustrate latency analysis and application instrumentation.
- What you can do after
- Diagnose latency with trace waterfalls, correlated logs, and metrics; add custom spans through the platform SDK.
Troubleshooting Java, Second Edition
A span is a recorded unit of work within a distributed trace, including its operation, timing, service, and associated metadata.
- How it is used
- Uses spans to reconstruct distributed request paths, compare service timing, and isolate failures across multi-hop workflows.
- How deep it goes
- Explains span relationships, fields, durations, and diagnostic patterns, but stops short of detailed tracing implementation internals.
- Examples
- Uses checkout traces, Kafka order processing, repeated payment attempts, and client-server timeout timelines.
- What you can do after
- Diagnose/debug with spans by tracing requests, interpreting timing, identifying retries, and comparing client-server behavior.
Read how Troubleshooting Java, Second Edition explains span →
Cloud Observability in Action
A span is a timed record of an individual operation or service segment within a distributed trace.
- How it is used
- Uses spans to visualize distributed request execution, investigate latency, troubleshoot failures, and correlate observability signals.
- How deep it goes
- Defines span structure, identifiers, propagation, sampling, visualization, and troubleshooting, while deferring backend-specific implementation details.
- Examples
- Uses checkout, billing, payment-provider, Go HTTP, happy-path, and injected-failure examples to demonstrate span timing and diagnosis.
- What you can do after
- Diagnose/debug with Jaeger by locating slow or failed services and comparing their spans with a healthy trace.
Quarkus in Action
A span is a recorded unit of work within a trace, such as a method invocation, database invocation, or remote request.
- How it is used
- Uses spans to follow individual operations within distributed requests and locate failures or slow processing.
- How deep it goes
- Defines span and trace IDs, nesting, and cross-service correlation, then shows how to inspect spans in Jaeger.
- Examples
- Shows a REST call with two database spans and a car-availability trace spanning three services.
- What you can do after
- Diagnose/debug with it by inspecting span relationships, timing, and request tags in Jaeger.
Spring Microservices in Action
A span is a timed unit of work represented within a distributed trace, often corresponding to an operation in a service.
- How it is used
- Uses spans to locate time spent across services and resource calls in a distributed transaction.
- How deep it goes
- Explains span timing and demonstrates custom span creation, tagging, event logging, and closure.
- Examples
- Shows a Zuul-to-organization-service trace and custom spans for Redis and Postgres lookups.
- What you can do after
- Diagnose slow service and resource calls using Spring Cloud Sleuth and Zipkin.
Secure APIs
A span is a recorded unit of work representing a step in the processing of a request or operation.
- How it is used
- Uses spans to observe API request processing, investigate errors, and expose security-relevant business-layer activity.
- How deep it goes
- Explains span structure, trace correlation, exception capture, and custom creation with attributes, without developing broader tracing internals.
- Examples
- Demonstrates GET /books request spans and a cart.create custom span containing user and cart attributes.
- What you can do after
- Diagnose/debug with it by correlating request events, inspecting attributes, and reconstructing exceptions through trace IDs.
Rust Web Development
A span is a structured context representing a period of execution in which events and other spans can occur.
- How it is used
- Organizes asynchronous web-application logs around request and function execution periods.
- How deep it goes
- Defines nested spans and explains async instrumentation and subscriber setup, without detailing span internals.
- Examples
- Uses nested request and database-fetch spans and an instrumented question handler with pagination events.
- What you can do after
- Apply spans using Tracing and Warp to give handler events execution context.
gRPC Microservices in Go
A span is a timed record of one operation within a distributed trace, including its metadata and relationships to other operations.
- How it is used
- Uses spans to inspect individual operations along a request’s path across microservices.
- How deep it goes
- Defines spans as single-operation records and examines their metadata and timings, while demonstrating interceptor setup rather than manual span creation.
- Examples
- Examines create-order, Payment Create, and database spans with operation timings, gRPC metadata, and a SQL statement.
- What you can do after
- Diagnose/debug with it by comparing operation durations and inspecting span metadata in Jaeger.
Spring AI in Action
A span is a timed record of one operation or component segment within a distributed trace.
- How it is used
- Uses spans to trace AI request handling across application components, vector-store operations, RAG processing, and model calls.
- How deep it goes
- Examines nested operations and span tags for diagnosis, but does not detail span creation or trace internals.
- Examples
- Uses the POST /ask trace, Qdrant query and add spans, RAG processing, and GPT-4o-mini calls.
- What you can do after
- Diagnose request behavior with Jaeger by inspecting span hierarchies and tags.
Also covered in
- Build an AI Agent (From Scratch)
- Designing AI AgentsIn early access (MEAP)
- AI Agents in Action, Second Edition
- AI Agents for Offensive SecurityIn early access (MEAP)
What to know first
- OpenTelemetryOpenTelemetry is an open, vendor-neutral observability standard and framework for instrumenting software and generating, collecting, and exporting telemetry such as traces, metrics, and logs.
- latencyLatency is the elapsed time between initiating an operation or request and receiving its corresponding result or observable response.
- trajectoryA trajectory is an ordered record of states, actions, events, or operations showing how an agent or system progresses through an execution or process.
- gRPCgRPC is an open-source remote procedure call framework for defining services and invoking them across process or network boundaries, commonly using Protocol Buffers and HTTP/2.
Related concepts
- trajectorypart of · A trajectory is an ordered record of states, actions, events, or operations showing how an agent or system progresses through an execution or process.
- generationincludes · A generation is a model-invocation record that stores model-specific output attributes such as token counts, cost, timing, and cache information.
- database transactionpart of · A database transaction is a bounded unit of database operations whose changes are treated as one logical whole, typically committed or rolled back together.
- Zipkinmeasured by · Zipkin is an open-source distributed tracing system for collecting, storing, querying, and visualizing trace and timing data across services.
- root spanincludes · A root span is the top-level span in a trace that represents the start or overall scope of an operation and may have child spans.
- child spanincludes · A child span is a trace span representing a sub-operation nested beneath a parent span in a distributed trace.
Questions about span
What is span?
A span is a record of an individual operation within a trace, including its timing, contextual information, and relationships to other operations.
Which Manning books explain span?
Designing AI Systems, Troubleshooting Java, Second Edition, Cloud Observability in Action, Quarkus in Action, Spring Microservices in Action, Secure APIs, Rust Web Development, gRPC Microservices in Go and 1 more.
What should I know before learning span?
Manning books that teach span usually introduce OpenTelemetry, latency, trajectory and gRPC first.
What kinds of span are there?
Kinds of span include generation, root span and child span.
What is span part of?
Span is part of trajectory. A trajectory is an ordered record of states, actions, events, or operations showing how an agent or system progresses through an execution or process.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.








