Context
When using LangSmith for tracing and monitoring, you may notice that some traces show an "incomplete" status. This can prevent accurate calculation of full trace metrics, including latency for the entire graph, even when individual step metrics are available.
Answer
An "incomplete" status in LangSmith means that the "end" event for a trace was never successfully received by the LangSmith server. This occurs because LangSmith ingests traces in a background thread to avoid adding overhead to your application.
Common causes for incomplete traces include:
Process termination before all traces are uploaded
Runs not sending completion signals
End times not being recorded for all steps
Network issues preventing data from reaching LangSmith
Update to the latest version of the LangSmith SDK
Before your program exits, call the following function to ensure all traces are submitted:
wait_for_all_tracers()Ensure all runs finish cleanly and send their completion signals
For self-hosted deployments: Configure background job settings to prevent status update failures:
BG_JOB_ISOLATED_LOOPS=true BG_JOB_TIMEOUT_SECS=1800 BG_JOB_SHUTDOWN_GRACE_PERIOD_SECS=300
Important notes:
There is no explicit timeout set by LangSmith for traces
LangSmith does not automatically retry incomplete traces
You may still see latency metrics for individual completed steps, but the full trace metrics won't be reliable until marked complete
Runs that get stuck in PENDING state due to infrastructure issues may eventually appear as incomplete traces when status updates fail to persist
Additional information available at: https://docs.smith.langchain.com/observability/how_to_guides/trace_with_langchain#ensure-all-traces-are-submitted-before-exiting