Tracing, OpenTelemetry and correlation
Trace a request across boundaries
A trace contains spans representing operations with a start, duration and parent relationship. Propagate trace context across HTTP and messaging boundaries using the supported instrumentation and propagators; asynchronous work may need span links rather than a single parent chain. In the synthetic example, checkout calls inventory and payment; their spans can overlap. A 150 ms payment span does not prove payment is the root cause: network delay and dependency work may be inside it. Inspect the critical path and compare healthy requests.
Use OpenTelemetry for new instrumentation
OpenTelemetry defines APIs, SDKs and a collector pipeline to receive, process and export telemetry. ADOT is an AWS distribution of OpenTelemetry. Choose compatible SDKs, configure resource attributes and an authenticated exporter, and test propagation and exporter failures in a disposable environment. A CloudWatch agent can also collect OpenTelemetry data using supported configurations. X-Ray is a trace analysis backend; its legacy SDKs and daemon entered maintenance mode on February 25, 2026, with security-only releases. AWS announces end of support for the legacy SDKs and daemon on February 25, 2027. It recommends OpenTelemetry instrumentation that exports traces to X-Ray; this notice is about those components, not shutdown of the X-Ray backend. In a migration pilot, compare parent/child trace links, error tags, sampling and dropped exports with the baseline.
Sampling and correlation
Use an opaque trace identifier in logs so that an engineer can join related events. The fixture uses short labels for teaching, not valid W3C trace IDs. A production trace context uses standard formats. Head sampling decides near the beginning; tail sampling can use completed span information but needs buffering and memory. Sampling 10% does not guarantee every error appears; biased sampling cannot be used directly for an unbiased request failure rate. Use independent request counters for the SLI. Never include tokens, payment details or raw personal data as span attributes.
Select the backend by requirement
For an AWS-centric service, CloudWatch Application Signals can show service health and related traces. For workloads using Prometheus metrics and PromQL, consider Amazon Managed Service for Prometheus and Amazon Managed Grafana for visualization; Grafana can also query CloudWatch, including supported PromQL metrics. Choose self-managed collectors when you need custom processing and can own upgrades and capacity. Managed backends reduce some operational work but still require access policies, collection design and cost controls. Check supported versions, Regions and ingest/query prices. In the fixture, trace t-b links checkout and payment logs; t-a is unrelated. A missing span means incomplete evidence, not proof the service was never called.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Tracing, OpenTelemetry and correlation — knowledge check
Reason about telemetry, distributed tracing and reliability objectives.
Which new instrumentation is recommended for X-Ray tracing?
What does a missing sampled span establish?
Where should a unique trace identifier normally be recorded?
What does tail sampling require?
Which service offers managed Prometheus-compatible metrics storage and queries?