Skip to content

feat: CrewAI integration and LangGraph node-level tracing#153

Merged
Siddhant-K-code merged 1 commit into
mainfrom
feat/v0.56.0-crewai-langgraph
May 31, 2026
Merged

feat: CrewAI integration and LangGraph node-level tracing#153
Siddhant-K-code merged 1 commit into
mainfrom
feat/v0.56.0-crewai-langgraph

Conversation

@Siddhant-K-code

Copy link
Copy Markdown
Owner

Closes #131

What changed

CrewAI integration (integrations/crewai.py)

Zero-code instrumentation for CrewAI. Install and enable:

pip install agent-trace[crewai]
from agent_trace.integrations import instrument_crewai
instrument_crewai()

Or via env var: AGENT_STRACE_AUTO_INSTRUMENT=crewai python my_crew.py

Patches:

  • Crew.kickoffsession_start / session_end with crew/task counts
  • Agent.execute_taskllm_request / llm_response with agent role and task description
  • Task.execute_synctool_call / tool_result with duration

LangGraph node-level tracing (integrations/langchain.py)

When langgraph is installed, instrument_langchain() now also patches StateGraph.compile to wrap each compiled node with decision + tool_result events, 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

  • crewai and langgraph added to _INTEGRATIONS, _DETECTABLE, _FRAMEWORK_PROBE
  • pyproject.toml: crewai = ["crewai>=0.28.0"] extra, included in all-integrations

32/32 tests passing.

- 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>
@Siddhant-K-code Siddhant-K-code added the enhancement New feature or request label May 31, 2026
@Siddhant-K-code Siddhant-K-code merged commit 5c56962 into main May 31, 2026
0 of 4 checks passed
@Siddhant-K-code Siddhant-K-code deleted the feat/v0.56.0-crewai-langgraph branch May 31, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant