trace ID
An identifier shared by every span and log line belonging to one request, so they can be found together.
In more detail
In W3C Trace Context it is a random 16-byte value, written as 32 hexadecimal characters, and travels between services in the traceparent header. Putting it in log records and error responses lets you jump from a user's report straight to the full trace. It must never be a metric label, because every request has a different one.
Examples
Kafka record header: ('trace-id', b'abc123')216363698b529b4a97b750923ceb3ffd (32 hexadecimal characters)The course service writes trace_id into every log line so you can jump from a slow trace to its records.Related terms
- span — One timed operation within a trace, such as handling a request or running a query, with its start, duration and attributes.
- Problem Details — A standard JSON shape for HTTP error responses, defined in RFC 9457, with members such as type, title, status, detail and instance.
- correlation ID — A unique value attached to one request and passed along everywhere it goes, so its logs and traces can be found together.
- structured logging — Writing each log entry as named fields, such as status, duration and request identifier, instead of a free-text sentence.
- span ID — A unique identifier for one span; each child span records its parent's span ID so the tree can be rebuilt.
- distributed tracing — Following one request across every service, queue and database it touches by recording linked spans that share a trace identifier.
- traceparent — The HTTP header defined by Trace Context that carries the trace identifier, parent span identifier and sampling flag between services.
- record header — A key and bytes-value pair attached to a record outside its value, used for metadata such as content type or a trace ID.
- event envelope — A standard outer structure that wraps an event's business payload with metadata such as event ID, type, version and time.
- trace — A record of one request’s whole journey through a system, made of nested spans that show where the time went.
- correlation — Linking evidence from different signals about the same event, for example from a metric spike to a trace to its log lines.
- exemplar — A trace ID attached to one observation inside a histogram bucket, so a dashboard can jump from a slow bucket to an example request.
Taught in
- Global Exception Handling and Problem Details — Modern .NET Core, C# & Enterprise Microservices
- Resilient Error Handling: Problem Details & Envelopes — Production Full-Stack Engineering
- Distributed Tracing: OpenTelemetry & Traceparent — Production Full-Stack Engineering
- Full-Stack System Verification: Capstone Integration — Production Full-Stack Engineering
- Headers, Envelopes And Event Metadata — Apache Kafka & Event Streaming
- Routing & Middleware: Path Parsing & Async Context — Node.js Internals & Backend Services
- The Three Signals: Logs, Metrics And Traces — Full-Stack Observability: Metrics, Tracing & Logging
- Structured Logging And Why Text Fails — Full-Stack Observability: Metrics, Tracing & Logging
- Cardinality And How It Bankrupts You — Full-Stack Observability: Metrics, Tracing & Logging
- The Prometheus Exposition Format — 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
- A Warning With An Address: Correlating Signals — 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
- 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
- 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
- Two Replicas, Half A Trace: Scaling The Collector — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Forty Four Of Sixty: The Mock And What It Tells You — OpenTelemetry Certified Associate (OTCA) Exam Prep
- Observability Sprint: One Failed Checkout — Prometheus Certified Associate (PCA) Exam Prep