span
One timed operation within a trace, such as handling a request or running a query, with its start, duration and attributes.
In more detail
Every span carries the trace ID and its own span ID; a child span also records its parent's span ID, which is how the tree is rebuilt. The first span of a request is the root span.
Examples
Next.js emits spans for routing, rendering and fetch automatically.GET /checkout span=ea7b5bf55eb561a4 parent=none
SELECT basket span=795b929e9a9a80fd parent=ea7b5bf55eb561a4Related terms
- trace — A record of one request’s whole journey through a system, made of nested spans that show where the time went.
- Trace Context — The standard way of passing a trace identifier and parent span identifier from one service to the next, usually in the traceparent header.
- OpenTelemetry — A vendor-neutral, open-source standard and set of tools for producing traces, metrics and logs and sending them to any backend.
- instrumentation — Code, often a library, that makes an application emit telemetry about its operations.
- distributed tracing — Following one request across every service, queue and database it touches by recording linked spans that share a trace identifier.
- span ID — A unique identifier for one span; each child span records its parent's span ID so the tree can be rebuilt.
- trace ID — An identifier shared by every span and log line belonging to one request, so they can be found together.
- tracer — The OpenTelemetry object code uses to start and end spans.
- span attribute — A typed key and value recorded on a span, such as http.route="/checkout", that explains what the work did.
- span status — A field on a span recording whether its operation failed (Error) or was explicitly marked as successful (Ok).
Taught in
- Build An MCP Server — AI Engineering: LLM Apps, RAG & Agents
- Tracing And Monitoring — AI Engineering: LLM Apps, RAG & Agents
- Capstone: The Tasks Assistant — AI Engineering: LLM Apps, RAG & Agents
- Observability: Logs, Metrics, Traces — Modern API Architecture: REST, GraphQL & gRPC
- OpenTelemetry, Container Publishing and Trimming — Modern .NET Core, C# & Enterprise Microservices
- Distributed Tracing: OpenTelemetry & Traceparent — Production Full-Stack Engineering
- Structured Logging & Correlation IDs: Context Stitching — Production Full-Stack Engineering
- Full-Stack System Verification: Capstone Integration — Production Full-Stack Engineering
- Script Optimization: next/script & Lazy Third Parties — Next.js 15 & Modern App Router Architecture
- Instrumentation: OpenTelemetry & Performance Spans — Next.js 15 & Modern App Router Architecture
- Native Module Systems: ESM Loader Hooks vs CommonJS — Node.js Internals & Backend Services
- Close Phase & Signal Dispatch: Sockets & Teardown — Node.js Internals & Backend Services
- The Three Signals: Logs, Metrics And Traces — Full-Stack Observability: Metrics, Tracing & Logging
- Cardinality And How It Bankrupts You — Full-Stack Observability: Metrics, Tracing & Logging
- OpenTelemetry: The Vendor Neutral Path — Full-Stack Observability: Metrics, Tracing & Logging
- Traces, Spans And Context Propagation — Full-Stack Observability: Metrics, Tracing & Logging
- Instrumenting A Service With Client Libraries — Full-Stack Observability: Metrics, Tracing & Logging
- Bringing The Three Signals Together — Full-Stack Observability: Metrics, Tracing & Logging
- A Worked Example Postmortem — Full-Stack Observability: Metrics, Tracing & Logging
- Fifteen Traces For Six Bookings: Where Context Was Lost — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Two Names For One Fact: Semantic Conventions And Resources — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Traces From A Script Nobody Touched: Instrumentation Approaches — OpenTelemetry Certified Associate (OTCA) Exam Prep
- A Warning With An Address: Correlating Signals — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Fundamentals Sprint: One Declined Card — OpenTelemetry Certified Associate (OTCA) Exam Prep
- A Library That Traces Nothing, Safely: API, SDK And Extension — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Fifty Two Spans, Four Requests: The Trace Data Model — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Three Hundred Milliseconds In One Place: Tracing In Code — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Keep Your Logger: The Logs Bridge And Log Records — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Fifty Five Characters: Trace Context And Baggage — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Six Out Of Twelve At One In Four: Samplers — OpenTelemetry Certified Associate (OTCA) Exam Prep
- The Spans Of A Job That Ended Too Soon: SDK Pipelines — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Nine Lines, Five Bugs: Configuring The SDK — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Six Launches, No Code Changes: Language Agents — OpenTelemetry Certified Associate (OTCA) Exam Prep
- API And SDK Sprint: Fourteen Predictions — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Sixty Two New Names: Collector Components And Pipelines — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Validated And Deaf: Checking A Collector Config — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Fifty Five In, Fifty Two Out: Transforming Data — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Which Node Was It? Collector Deployment Patterns — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Two Replicas, Half A Trace: Scaling The Collector — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Collector Sprint: Sixteen Predictions — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Fifty Four In, Two Out: Debugging A Pipeline — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Failed Twice, Flushed Fine: Error Handling And Schemas — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Maintenance Sprint: Symptoms First — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Forty Four Of Sixty: The Mock And What It Tells You — OpenTelemetry Certified Associate (OTCA) Exam Prep
- The Evening Before: Final Review — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Observability Sprint: One Failed Checkout — Prometheus Certified Associate (PCA) Exam Prep