openllmetry icon indicating copy to clipboard operation
openllmetry copied to clipboard

πŸš€ Feature: Add `graph_structure` attribute to LangGraph instrumentation

Open ronensc opened this issue 1 month ago β€’ 3 comments

Which component is this feature for?

Langchain Instrumentation

πŸ”– Feature description

Add an attribute named graph_structure to the main LangGraph workflow span that represents the structure of the invoked graph, i.e., the nodes and edges that compose it.

🎀 Why is this feature needed ?

Currently, there is no way to reconstruct the executed graph from the exported spans.
Including a graph_structure attribute would allow visualizing and analyzing the shape of the LangGraph workflow (e.g., nodes, edges, and branching paths) within a trace visualization or observability platform. This enables better understanding of execution flow and easier debugging of agentic workflows.

✌️ How do you aim to achieve this?

An initial implementation will be proposed via a pull request, adding the graph_structure attribute to the root LangGraph workflow span.

πŸ”„οΈ Additional Information

No response

πŸ‘€ Have you spent some time to check if this feature request has been raised before?

  • [x] I checked and didn't find similar issue

Are you willing to submit PR?

Yes I am willing to submit a PR!

ronensc avatar Nov 12 '25 09:11 ronensc

Sounds good @ronensc!

nirga avatar Nov 13 '25 11:11 nirga

that a smart idea to have this attribute. @ronensc please assign this task to me

Avijeet-Mandal avatar Nov 17 '25 19:11 Avijeet-Mandal

Thanks @Avijeet-Mandal! I have an initial implementation including a basic test that you might find useful as a starting point: https://github.com/traceloop/openllmetry/commit/585062016736a8c9324b03360992277fa4bf136c

ronensc avatar Nov 18 '25 08:11 ronensc

that helpsπŸ˜€. looking into it. @ronensc

Avijeet-Mandal avatar Nov 19 '25 15:11 Avijeet-Mandal