feat: Add LangGraph workflow auto-detection and agent tag parsing#132
Open
NikitaVoitov wants to merge 1 commit intosignalfx:mainfrom
Open
feat: Add LangGraph workflow auto-detection and agent tag parsing#132NikitaVoitov wants to merge 1 commit intosignalfx:mainfrom
NikitaVoitov wants to merge 1 commit intosignalfx:mainfrom
Conversation
- Auto-detect LangGraph from metadata keys (langgraph_version, graph_id) - Set workflow_type='graph' and framework='langgraph' for LangGraph workflows - Parse agent attributes from tags (agent_type:, agent_description:, agent_tools:) - Support description: tag for workflows - Generate workflow description from graph_id if not provided - Add 5 tests for LangGraph detection and agent tag parsing This enables proper agent flow visualization in O11y and supports LangGraph dev server which replaces custom metadata but preserves tags
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds automatic detection of LangGraph workflows and parsing of agent attributes from tags.
Problem
The current instrumentation lacks:
workflow_typeorframeworkattributesRoot Cause
on_chain_startdoesn't check for LangGraph-specific metadata keys (langgraph_version,graph_id)agent_type:,agent_description:,agent_tools:) aren't parseddescription:tags andls_descriptionmetadata aren't extractedSolution
1. LangGraph Auto-Detection
2. Agent Tag Parsing
3. Workflow Description from Tags
Evidence
Before Fix (trace
27ba4165c26889bb6d328fd356d9381d)gen_ai.workflow.typegen_ai.frameworkgen_ai.workflow.descriptiongen_ai.agent.typegen_ai.agent.descriptiongen_ai.agent.toolsAfter Fix
Agent trace (
fe915fd88fd3c8542e2adee30b42559f):gen_ai.agent.namehealthcare_agentgen_ai.agent.typereactgen_ai.agent.descriptionHealthcare agentgen_ai.agent.tools["query_member_data","search_knowledge_base"]gen_ai.frameworklangchainWorkflow trace (
8593063fe9ba82df06d5f7a126e658b2):gen_ai.workflow.typegraphgen_ai.workflow.descriptionHealthcare processing workflowgen_ai.frameworklanggraphTesting
Added 5 unit tests:
test_langgraph_workflow_auto_detection_from_metadatatest_agent_tag_parsing_nametest_agent_tag_parsing_type_and_descriptiontest_agent_tag_parsing_toolstest_description_tag_for_workflowFiles Changed
callback_handler.pytest_callback_handler_agent.pyWhy This Matters
workflow_typeenables proper visualization in Splunk O11y