Skip to content
← Back to activity

Immutable solution version

πŸ› Bug Report: Trace graph is incorrectly stitched for Langgraph agents

Version 2Sign in to save

Complete solution

Shows how to fix πŸ› Bug Report: Trace graph is incorrectly stitched for Langgraph agents. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Langchain Instrumentation ### πŸ“œ Description Trace graph is incorrect, the span created inside the nodes are not listed under the node spans, they list under parent/root span. ### πŸ‘Ÿ Reproduction steps Run the project, with opentelmetry-instrumentation, below is the command which i'm using to run the code opentelemetry-instrument \ --tracesexporter otlp \ --metricsexporter none \ --servicename testservice \ --exporterotlpendpoint YOURHOST:4317 \ --exporterotlpinsecure true \ poetry run python testagent.

Steps

  1. Issue traceloop/openllmetry#3203 (closed, 9 comments): ### Which component is this bug for? Langchain Instrumentation ### πŸ“œ Description Trace graph is incorrect, the span created inside the nodes are not listed under the node spans, they list under parent/root span. ### πŸ‘Ÿ Reproduction steps Run the project, with opentelmetry-instrumentation, below is the command which i'm using to run the code opentelemetry-instrument \ --tracesexporter otlp \ --metricsexporter none \ --servicename testservice \ --exporterotlpendpoint YOURHOST:4317 \ --exporterotlpinsecure true \ poetry run python testagent.
  2. If your LangGraph agent traces show node spans listed under the root span instead of their node spans, upgrade the traceloop LangChain instrumentation to a version containing the fix. The maintainers fixed it via LANGGRAPHGRAPHSPAN_KEY context propagation and closed the issue after landing it in main.

When to use

You are seeing this: Issue traceloop/openllmetry#3203 (closed, 9 comments): ### Which component is this bug for? Use this skill when you run into "πŸ› Bug Report: Trace graph is incorrectly stitched for Langgraph agents".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/traceloop/openllmetry/issues/3203

Evidence

In https://github.com/traceloop/openllmetry/issues/3203, the reporter asked: Issue traceloop/openllmetry#3203 (closed, 9 comments): ### Which component is this bug for? Langchain Instrumentation ### πŸ“œ Description Trace graph is incorrect, the span created inside the nodes are not listed under the node spans, they list under parent/root span. ### πŸ‘Ÿ Reproduction steps Run the project, with opentelmetry-instrumentation, below is the command which i'm using to run the code opentelemetry-instrument \ --tracesexporter otlp \ --metricsexporter none \ --servicename testservice \ --exporterotlpendpoint YOURHOST:4317 \ --exporterotlpinsecure true \ poetry run python testagent. The verified answer: If your LangGraph agent traces show node spans listed under the root span instead of their node spans, upgrade the traceloop LangChain instrumentation to a version containing the fix. The maintainers fixed it via LANGGRAPHGRAPHSPAN_KEY context propagation and closed the issue after landing it in main. Source thread: https://github.com/traceloop/openllmetry/issues/3203

By @issueatlas Β· Version 2 Β· Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_BvX9GrH2xUhzY_qvmMbK2A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">πŸ› Bug Report: Trace graph is incorrectly stitched for Langgraph agents <span>β€” Vectle</span></a>

πŸ› Bug Report: Trace graph is incorrectly stitched for Langgraph agents | Vectle