Why OpenTelemetry traces break into pieces and when to fix them first
A trace view that shows orphaned spans, a service hop that never appears, or a root span that never arrives is a signal that context stopped moving between services. The first question is where the break happens, not where the data is stored. OpenTelemetry is a framework and toolkit for generating, exporting and collecting telemetry, and it is not an observability backend. That means a fragmented trace usually originates in instrumentation, in the propagation of trace context across process boundaries, or in sampling decisions made at different points, and only rarely in the storage or visualization tool. Before you change the backend, check what each service emits and what arrives at the Collector, using the span IDs and parent IDs on the orphaned spans as your evidence.
Fix broken traces before you widen tracing to more services. Each new service adds another place where context can be dropped or written in a different format, so a gap that is tolerable in two services becomes hard to attribute across twenty. The same applies after a migration, such as moving from one instrumentation library to OpenTelemetry, changing the HTTP client, or introducing a message queue or a batch job. Those changes often leave some hops propagating context and others silently starting new traces. Confirm the parent-child relationships on a handful of representative requests in each environment before you roll the change out further.
Ask your platform team to confirm three things before the work starts: which propagation formats each service sends and accepts, whether head sampling is configured in more than one place, and how the hosts that produce spans keep their clocks synchronized. Those answers determine the order of the fixes in this topic. Note that the exact behavior of each SDK and Collector component depends on its version and stability level, which are documented in the OpenTelemetry status page, so confirm the versions you run against that page rather than assuming them.
Which failure pattern you are seeing
Broken traces usually look alike in the trace view: a root span with no children, a child that starts a new trace, or a span that appears without its parent. The causes below produce those shapes in different ways, so match the symptom first and run the matching check before changing any configuration.
Missing context across queues and async work
The trace stops at the producer. The web request span is complete, but the consumer that processes the message starts a new trace with no parent. This happens when the trace context is not written into message headers, or when a worker thread, callback or background task runs without the active context. Check whether the message carries a traceparent header and whether the consumer extracts it before it starts its span.
Mixed propagation formats between services
Two services in the same request path use different header formats. One service sends W3C Trace Context headers while another expects B3 or a vendor header, so the receiving service sees no parent and starts a new trace. The symptom is a clean trace inside each service but a break at the hop between them. Check which propagators each service is configured with and make sure the set agrees across every hop, including proxies and gateways that may strip unknown headers.
Sampling decisions that disagree
Some spans of a trace are kept and others are missing. Each service makes its own sampling decision, so a parent sampled out in one service can leave its children recorded in another, or the reverse. The trace view then shows orphaned spans or gaps that appear only under load. Check the sampler type and ratio in every service, and confirm that the sampled flag in incoming headers is respected rather than overridden by a local rule.
Clock skew between hosts
A child span starts before its parent or ends after it. Spans are timed by the clock of the host that created them, so hosts with drifting clocks produce impossible timelines even when the parent-child links are correct. The trace looks broken but the relationships are intact. Compare the host time sources and synchronization status on the hosts involved, and check whether the gap is a consistent offset for one host.
Spans dropped in the pipeline
Spans exist in the application but are absent from the backend. The application creates the full trace, but the Collector refuses, batches out or fails to export part of it, so the backend receives only some spans. This pattern is confirmed by comparing span counts at the application, at the Collector receiver and at the exporter. Check the Collector's accepted and refused span counters and its exporter failure counters before you look at instrumentation.
Collector docsFixing mixed propagation formats across services
When every service runs OpenTelemetry SDKs and uses the same propagator, the main risk is not format mismatch but a service that was never configured. Propagators are set in each SDK, and the default is usually the W3C Trace Context format, but defaults vary by language and version, so confirm the exact propagator names and defaults in your language SDK documentation before you rely on them. Set the same propagator list in every service, including workers and batch jobs that rarely receive direct HTTP calls.
- Pin the propagator explicitly: Set the propagator list through the SDK's environment variable or code configuration instead of relying on the default, so a library upgrade cannot silently change it.
- Cover non-HTTP carriers: Queue producers and consumers must inject and extract context into message headers or attributes, using the same propagator as HTTP services.
- Check every language runtime: A single service in a different language with a different default can break the chain for its neighbors.
- Include baggage deliberately: If baggage is part of the propagator list, confirm each service expects it, since extra headers add size to every request.
- Confirm on the wire: Capture an outbound request from one service and check that the trace header is present and carries the expected trace ID.
Before you move on, confirm that the same trace ID appears in the spans of at least two services that call each other, for a request that crosses a queue.
In a mixed fleet, some services still emit an older header format while newer ones emit W3C Trace Context. A service that extracts only one format will start a new trace when it receives the other, which shows up as a root span with no parent. The safe pattern is to extract every format the fleet can send, but inject only the format you intend to keep, and to plan a removal date for the older one. Listing several propagators in the extraction side is a configuration choice you should confirm against your SDK documentation, since the names and order rules differ by language.
- Extract before you inject: Roll out support for reading the older format across all services first, then switch injection to the target format once every reader is updated.
- Accept one format while emitting another with care: A service that reads format A and writes format B breaks any downstream service that only reads A. Treat this as a temporary state with an end date.
- Watch for duplicate headers: Some proxies and gateways forward both formats. Check which header a downstream service actually uses when both are present.
- Record the inventory: List which services emit which format, by language and by team, so the migration has a clear finish line.
- Test with a mixed request path: Send a request through an old service and a new service and confirm the spans link into a single trace.
Check that no span in your sample traces appears as an unexpected root when its caller is a known instrumented service.
A legacy tracing library bridging into OpenTelemetry is the highest-risk case because two tracers may each create their own context and headers. Bridge or compatibility layers can translate between formats, but their behavior depends on the library version, the bridge package, and the order in which instrumentation loads. Confirm the bridge's supported propagators and its documented limits in the SDK documentation for your language before you run it in production. Treat the bridge as a temporary component with a clear retirement plan.
- Pick one owner of the context: Make sure the legacy tracer and the OpenTelemetry SDK do not both start root spans for the same request.
- Check load order: Initialize the bridge before the frameworks it instruments, since late registration can leave some calls untraced or split.
- Verify both directions: Confirm that context flows from legacy code into OpenTelemetry code and back out, because bridges often handle only one direction well.
- Log the active propagator at startup: A startup log line naming the configured propagators makes misconfiguration visible without a packet capture.
- Plan the retirement: Record which services depend on the bridge so that removing it does not break traces in services that still rely on it.
After a deployment, confirm that requests passing through the bridged service produce one trace with no duplicate root spans.
How to trace the break from the edge to the pipeline
This sequence takes one incomplete trace and follows it hop by hop, from the inbound request to the Collector export, so the team can see exactly where the trace ID or sampling decision is lost. Each step ends with a specific check, which tells you which component to fix next.
Pick one incomplete trace ID
Start from a single trace that shows fewer spans than the request should produce, not from an aggregate dashboard. Record its trace ID, the entry service, the time of the request, and the list of services you expected to see. Someone on the platform or on-call team does this in your tracing back end, and the step is done when you have one ID and a written list of expected hops. Keep the same ID through every following step so each check tests the same request.
Confirm the inbound request carried trace headers
Check the access logs of the edge component (load balancer, API gateway or ingress) and the entry service for the traceparent header, or for whichever propagation header your SDKs use. If the header is absent at the edge, the break happens before your instrumentation runs, and the fix belongs to the proxy configuration or the calling client. If the header is present at the edge but missing at the entry service, a proxy or middleware is stripping or rewriting it. The check ends when you know which hop first lost the header, or when you confirm that the entry service received it intact.
Check each outbound call and queue message
Walk the expected hops in order. For each HTTP or gRPC call, confirm the downstream service logged the same trace ID. For each queue or async job, inspect the message headers or attributes on the producer side and confirm the consumer restored the context before starting its span. Missing context at a queue usually means the producer never injected it, or the consumer started a new root span. The check ends when every hop either shows the trace ID or you have named the first hop where it disappears.
Compare the sampled flag across services
Look at the trace flags in the propagated context at each hop. If one service records the parent as sampled and a downstream service treats it as not sampled, you have disagreeing sampling decisions, and the trace will show gaps even though context propagated correctly. Also check whether any service applies its own head sampler and ignores the parent decision. Confirm that every service honors the upstream sampling decision or that your sampling policy is designed for consistent decisions across the trace. The check ends when the flag is consistent along the path or you have found the service that overrides it.
Check span timestamps for negative gaps
Order the spans of the trace by start time and compare each child span with its parent. A child that starts before its parent, or ends after it, often points to clock skew between hosts rather than a missing span. Compare the hosts involved, check whether they synchronize time through NTP or a platform time service, and note which host clock is ahead or behind. Clock problems distort the visual order of a trace but do not remove spans. The check ends when you either find no negative gaps or have identified the host whose clock is out of step.
Confirm the Collector received and exported the spans
Now check the pipeline itself. Use the Collector's own telemetry, or a temporary debug exporter in a non-production environment, to confirm that spans from the affected services reached the receiver and left through the exporter. Look for refused spans at the receiver, dropped spans in the processors, and export failures or retries at the exporter. Compare the span counts for the affected service over the same window. The check ends when the spans appear at the receiver and the exporter reports success, which means the break is in the back end or in the instrumentation. If the spans never reached the receiver, the break is between the service and the Collector, and the network path and exporter endpoint configuration should be confirmed next.
Why sampling decisions and clock skew split traces
A trace splits into orphaned pieces most often because sampling decisions disagree across services, or because host clocks disagree with each other. Start by checking both, since they look similar in a backend: the trace exists, but its tree is incomplete or its spans appear in the wrong order. Under head sampling, the root service decides once whether to keep a trace, and the decision travels with the context in the traceparent header. If a downstream service runs its own sampler, or a parentbased sampler is configured without honoring the parent's sampled flag, it can record child spans whose parent was dropped upstream. Those children arrive as orphans. Confirm that every service uses the same sampler configuration and that each one respects the parent's decision.
Tail sampling adds a stricter requirement. The tail_sampling processor in the Collector must see all spans of a trace before it decides, so every span for a trace ID has to reach the same Collector instance. When a load balancer spreads spans across several gateway Collectors, each instance holds only part of the trace, and the policy keeps or discards fragments inconsistently. Route spans by trace ID to a single tier, such as a load-balancing exporter in front of the tail sampling gateways, and confirm the routing with a test trace that crosses services. Plan this topology before scaling out the gateway tier.
Clock skew can make a correct tree look broken. If a child span's host clock runs behind its parent's host, the child appears to start before the parent, and some views drop or misplace it. This happens even when context propagation is intact, so context problems should be ruled out first but not assumed. Make host time synchronization a precondition: confirm that each host runs a time daemon and that the offsets are small compared with the spans you inspect. Ask your platform team which synchronization service and monitoring they use, and set an alert on drift. Then compare the same trace after synchronization is fixed. The acceptable skew depends on your latency targets, and the OpenTelemetry documentation does not set a single threshold you can apply.
Fix options and when each one fits
This table compares the five main repairs for fragmented traces, showing what each one fixes, when it is the right tool, and what it costs in effort or risk. Read it by first identifying the symptom in your traces, then matching that symptom to the row that addresses its cause rather than applying every fix at once.
| Option | What it repairs | When it fits | Effort or risk |
|---|---|---|---|
| Fix propagation in code | Lost trace context at queues, background jobs, threads and outbound calls where the parent span ID is not carried forward | Spans for one request appear as separate traces, or a consumer span has no parent, and the break sits at a specific handoff in your code | Moderate effort across each service touched; risk is low if changes are tested per handoff, but every service owner must agree on the carrier |
| Standardize propagation formats | Traces split because one service sends one header format and the next reads another, for example a legacy tracing header alongside W3C Trace Context | Services were instrumented at different times or through different libraries, and the mismatch appears only between certain service pairs | Low to moderate effort in configuration; risk comes from a rolling change where some services still expect the old format during the transition |
| Configure a consistent sampler | Sampling decisions that disagree across services, so a parent is kept and its children are dropped or the reverse | Head sampling is configured differently per service or per environment, and sampled traces show gaps that match sampling settings | Low effort per service but requires an agreed policy; risk is lost data during rollout if sampler settings are changed piecemeal |
| Gateway routing for tail sampling | Tail-sampled traces fragmented because spans for one trace reach different Collector instances, so no instance sees the whole trace | You run tail sampling across several Collector replicas and see complete traces only when one instance handles all spans | Higher effort: needs a routing tier keyed on trace ID and capacity planning; risk of an overloaded or failed routing instance affecting all traces |
| Collector-side timestamp or attribute processing | Spans with inconsistent attribute names or timestamps that are shifted, so they appear out of order or fail to join | Upstream services cannot be changed quickly, and the problem is a known rename or a predictable timestamp offset that a processor can correct | Low to moderate effort; risk is masking the root cause and silently rewriting data, so confirm each rule against a sample of real spans |
| Fix host time sync | Child spans that appear to start before their parents or end after them because host clocks disagree | Ordering anomalies appear across machines but not within a single host, and clocks drift between hosts | Low effort in the platform layer; confirm the time source with your infrastructure team, since processors cannot fully correct unsynchronized clocks |
Where context and spans can be lost on a request path
The request starts at a client and enters an HTTP service, which hands work to a message queue and then to a worker that calls a database. Each hand-off is a place where trace context can be dropped: the queue message carries headers only if the producer injects them, and the worker only links to the parent if it extracts them. Sampling decisions are made at the first service and at the Collector, so they can disagree along the path. Check each hand-off, then confirm the Collector gateway receives spans from every service before the backend.
Trace context hand-offs and sampling points, with the Collector shown as a pipeline component.
Security and data handling while debugging traces
Debugging broken traces often means looking at raw span attributes, headers and Collector settings, which can expose more than the original problem. The cards below cover the controls to put in place before you widen access to trace data or open diagnostic endpoints.
Trace attributes may carry personal data
Span attributes often capture URLs, query strings, user identifiers, email addresses or request bodies added by instrumentation. When you inspect a broken trace, those values become visible to everyone with access to the backend. Before widening access, identify which attributes carry personal or regulated data and remove them with the redaction processor described in OpenTelemetry's security guidance. Confirm the processor runs in the pipeline you are debugging, not only in production.
Security best practicesStore Collector configuration securely
Collector configuration files can contain exporter endpoints, tokens and authentication settings used while you troubleshoot. Keep them in a secrets store or an access-controlled repository rather than copying them into tickets, chat or shared debug folders. Limit who can read the running configuration and rotate any credential that appeared in a debug session. Ask your security team which store your organization already audits.
Keep debugging endpoints off the network
Diagnostic endpoints such as zPages and pprof reveal internal pipeline state and memory details. Expose them only for the duration of an investigation, and bind them to localhost or reach them through a port-forward or an SSH tunnel. Remove the exposure once the investigation closes, and record the change so it does not persist in a shared configuration.
Confirm localhost binding after upgrades
Since Collector v0.110.0, server components bind to localhost by default instead of all interfaces. Older configurations, copied examples or custom receiver settings may still set a wide bind address. Check the effective listen address of each receiver and extension after every upgrade, and verify that a change to 0.0.0.0 is deliberate and covered by network controls or an authenticator extension.
Stop propagated headers at trust boundaries
Context propagation headers such as traceparent, along with baggage entries, travel with requests across services, queues and third-party calls. Baggage can carry tokens, session values or tenant details that were never meant for a partner or external API. Review what your services place in baggage, strip or filter headers at the edge of each trust boundary, and avoid forwarding internal values to outside systems while you chase a missing span.
Limit who can read trace data
Once a broken trace is fixed, the sensitive values it exposed may still be stored in the backend and in exported files. Restrict query access to the teams that need it, check retention settings for the trace backend, and remove raw exports you saved during debugging. Confirm with your compliance owner how long debugging snapshots may be kept and where they must be deleted.
Questions teams ask before fixing broken traces
How much effort does fixing broken traces usually take?
The effort depends mainly on how many services are involved, which languages they use, how many queues or asynchronous hand-offs sit between them, and how sampling is designed. A team with a few services on one language and one propagation format has a small, contained repair. A estate with many services, mixed runtimes and several message brokers needs a longer survey before any code changes. Ask for the work to be split into a discovery phase that maps every hop where context is lost, and a fix phase scoped against that map. Quotes should name the number of services and hand-off types they cover.
Can our own engineers fix broken traces without outside help?
Often yes, if the team already runs OpenTelemetry in production and owns the services involved. The work is mostly careful reading of trace trees, checking how each service extracts and injects context, and fixing carrier code in queues, background jobs and HTTP clients. Teams with no prior tracing experience, or with services owned by several groups, usually take longer because the root cause sits across ownership boundaries. A useful test is whether one engineer can name, for a sample broken trace, the exact service where the parent span ID is lost.
What do we need to provide for a trace repair?
Expect to provide four things: read access to the code of each service in the broken paths, a test environment where propagation changes can be exercised without touching production, read access to the tracing backend so broken traces can be found and compared, and time from the owners of each service. Service owners matter most for asynchronous code, because they know which message headers or job arguments carry context and which libraries were customized. Agree on these access and time commitments in the written scope before work starts, so delays do not surface mid-engagement.
Is a trace repair a one-time task or ongoing work?
The initial repair is one-time, but keeping traces whole is ongoing. Each new service, queue, language runtime or library upgrade can reintroduce a break, and new sampling rules can split traces that were previously kept together. Teams usually add a small set of checks to their release process, such as a test that asserts a parent span exists in a staging trace, and review propagation settings whenever a messaging client changes. Ask any provider which of these checks will be handed over and which will need a continuing retainer.
How do we confirm a trace fix actually worked?
Confirm the fix with measurements rather than by looking at a few traces. Pick a set of representative request paths that cross queues and async boundaries, generate test traffic, and check that each path produces one trace ID with a complete parent-child tree from entry point to the last consumer. Then check the same paths in production over a period of normal traffic, and watch for orphaned spans, new root spans appearing mid-path, and traces whose timestamps run backward across services. Record the test cases so they can be rerun after each change.
When is it worth bringing in a consultant for broken traces?
Bring in outside help when the breaks span several teams, when services use mixed propagation formats such as W3C Trace Context alongside older B3 or custom headers, or when sampling decisions disagree between services and no one can say which component decides. It is also worth it when the team needs the repair documented for auditors or when the pipeline feeds security or compliance evidence. DeployOpen implements, customizes, documents and supports self-hosted OpenTelemetry pipelines in the client's own infrastructure, and can scope a fixed engagement from a written survey of the affected paths.
Does clock skew break traces, and how do we check for it?
Clock skew does not usually drop spans, but it makes parent and child timestamps appear out of order, which confuses latency analysis and can hide the true cause of a slow hop. Check it by comparing host clock sources and sync status across the services in one trace, and by looking for child spans that start before their parent. Fixing it is mostly an infrastructure task: confirm that every host and container runs a time synchronization service against sources you control, then re-test the same paths after the change.
Repair sequence for a self-hosted OpenTelemetry pipeline
This sequence takes a partly working OpenTelemetry deployment and makes it produce complete, correctly linked traces, with a check at each step so the team knows which fault it has fixed. It is meant to be run in order, because later steps depend on the earlier ones being verified.
Inventory services, queues and async hops
List every service, worker, scheduled job and message queue that sits on a request path, and mark each point where work leaves the synchronous call stack: message publishes, background threads, thread pools, cron jobs and batch consumers. Record which SDK and version each service uses and whether it is instrumented at all. The step is done when every hop on a sample business transaction is on the list, with an owner for each service. Ask your team to confirm the list against a real request flow, not only the architecture diagram.
Standardize the propagator across services
Choose one propagation format for the whole estate, most often the W3C Trace Context headers, and configure every SDK and any proxy or gateway in front of the services to use it. Look for leftover legacy formats from older tracing libraries, which can silently start a new trace at each hop. Verification: send one request through two services and confirm that the downstream span carries the same trace ID and a parent span ID from the upstream service. Repeat for each pair of services in the inventory.
Fix queue and async context handoff
At each async boundary from the inventory, the producer must write the current trace context into the message (as headers or message attributes), and the consumer must extract it and start its span as a child of that context. Check thread pools and task executors, because context often does not follow work onto a new thread unless the framework or SDK wraps the executor. Verification: publish one message, process it, and confirm that the consumer span appears under the producer span with the same trace ID, and that no orphan root span is created.
Set one sampling strategy and confirm tail sampling placement
Decide on one sampling approach for the whole pipeline. Head sampling made in the first service must be honored by downstream services, so they should follow the parent's sampled flag rather than make an independent decision. If you use tail sampling, confirm that all spans of a trace reach the same Collector instance that makes the decision, which usually requires a load-balancing tier keyed on trace ID. Verification: generate traces that cross three or more services and confirm that each kept trace is complete, with no trace showing some spans sampled and others missing.
Verify host clock synchronization
Check that every host and container node runs a time synchronization service and that the clocks agree closely across all services in one trace. Skewed clocks make child spans appear to start before their parents, or give negative durations, which often looks like a broken trace even when context is correct. Ask your platform team which time source the estate uses and how drift is monitored. Verification: compare the timestamps of a parent span and a child span across two hosts in the same request, and confirm that the child starts after the parent ends or starts within the expected network delay.
Run a test request end to end and confirm it in the backend
Send a single tagged test request through the public entry point, across every service on the path, including the async hops. Then open the trace in your tracing backend and check that all expected spans are present, correctly nested, carry the same trace ID, and show the test attribute. Compare the result with the inventory from the first step. Record any missing span and its service so it can be traced to a specific fix. The step is done when one test trace is complete from the entry point to the last consumer.
Add a regression check for trace completeness
Turn the manual test into an automated check that runs on a schedule and after each deployment that changes instrumentation, the Collector configuration or the sampling policy. A common approach is a synthetic transaction that writes a known marker and then queries the backend for a trace with the expected number of spans and services. Alert when the check fails or returns fewer spans than expected. Verification: deliberately break one propagator setting in a non-production environment and confirm that the check fails and names the affected pair of services.
How DeployOpen scopes and delivers trace repair
DeployOpen approaches broken and incomplete OpenTelemetry traces by first mapping where context is lost across services, queues and sampling points, then fixing the instrumentation and Collector configuration that causes it. Work runs inside your own infrastructure, and each engagement ends with documented fixes your team can operate and verify.
How we scope
- Agree in writing which services, queues, async jobs and pipelines are in scope before work starts.
- Confirm the trace propagation formats in use and the Collector deployment pattern for each environment.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before any change is made.
How we build
- Trace a sample of incomplete requests end to end to locate where the parent span context is dropped.
- Correct propagation in instrumentation and Collector pipelines, and test each fix against the failing paths.
- Check sampling settings and host clock sync so decisions agree and timestamps order correctly across services.
How we hand over
- Deliver a written record of each root cause, the change made, and the test that confirms the fix.
- Document the propagation standard, sampling policy and clock requirements your teams must keep in place.
- Walk your engineers through the repaired pipeline and the checks they can rerun without DeployOpen.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers for pipelines that keep changing.
- Retainer scope, response expectations and review cadence are agreed in writing, and quoted separately from the project.
- Ask for a quote built from the written scope, since DeployOpen does not publish a price list.

