openllmetry
openllmetry copied to clipboard
π Feature: Add `graph_structure` attribute to LangGraph instrumentation
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!
Sounds good @ronensc!
that a smart idea to have this attribute. @ronensc please assign this task to me
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
that helpsπ. looking into it. @ronensc