LangChain

LangGraph Agent Execution Trace Fragmentation

critical
reliabilityUpdated Jul 9, 2025

LangGraph agents executing async tasks or parallel workflows create orphaned spans when OpenTelemetry context doesn't propagate across async boundaries, resulting in disconnected traces that make debugging multi-step agent workflows nearly impossible.

How to detect:

Detect when LangGraph traces show orphaned spans, missing parent-child relationships between agent nodes, or async tasks appearing as separate traces. Monitor for spans with no parent span ID or traces with unexpected root spans during concurrent operations.

Recommended action:

Manually propagate OpenTelemetry context using context.attach() and context.detach() wrappers around async LangGraph node functions. Ensure all parallel document processing or concurrent chain invocations preserve the current context token before spawning tasks.