feat: CrewAI integration and LangGraph node-level tracing#153
Merged
Conversation
- integrations/crewai.py: new integration patching Crew.kickoff, Agent.execute_task, and Task.execute_sync to emit session_start, llm_request/response, and tool_call/result events - integrations/langchain.py: add LangGraph StateGraph.compile patch that wraps each compiled node with decision + tool_result events; uninstrument_langchain now properly restores all three patches - integrations/__init__.py: register crewai and langgraph aliases, add instrument_crewai() export, add to _DETECTABLE/_FRAMEWORK_PROBE - pyproject.toml: add crewai optional extra and include in all-integrations Closes #131 Co-authored-by: Ona <no-reply@ona.com>
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.
Closes #131
What changed
CrewAI integration (
integrations/crewai.py)Zero-code instrumentation for CrewAI. Install and enable:
Or via env var:
AGENT_STRACE_AUTO_INSTRUMENT=crewai python my_crew.pyPatches:
Crew.kickoff→session_start/session_endwith crew/task countsAgent.execute_task→llm_request/llm_responsewith agent role and task descriptionTask.execute_sync→tool_call/tool_resultwith durationLangGraph node-level tracing (
integrations/langchain.py)When
langgraphis installed,instrument_langchain()now also patchesStateGraph.compileto wrap each compiled node withdecision+tool_resultevents, giving per-node latency and error visibility. Falls back silently if LangGraph is not installed.uninstrument_langchain()now properly restores all three patches (tool run, generate, compile).Registry
crewaiandlanggraphadded to_INTEGRATIONS,_DETECTABLE,_FRAMEWORK_PROBEpyproject.toml:crewai = ["crewai>=0.28.0"]extra, included inall-integrations32/32 tests passing.