CrewAI Integration
OpenTelemetry-native CrewAI integration. Set two environment variables and every crew task, agent, and tool call flows into Zespan — no code changes.
CrewAI is a Python framework for orchestrating multi-agent systems where crews of specialized AI agents collaborate on tasks.

Getting Started
Install the SDK
Install zespan alongside crewai.
pip install zespan crewaiSet environment variables
Zespan integrates with CrewAI via OpenTelemetry. Set these two variables before starting your crew — no code changes required.
import os
os.environ["ZESPAN_API_KEY"] = "your-api-key"
os.environ["CREWAI_OTEL_ENV"] = "production"
# Your existing CrewAI code unchanged
from crewai import Crew, Agent, Task
researcher = Agent(role='Researcher', goal='...', backstory='...')
writer = Agent(role='Writer', goal='...', backstory='...')
crew = Crew(agents=[researcher, writer], tasks=[...])
result = crew.kickoff()View traces in Zespan
Open the Agent Registry and Delegation Graph. Every crew agent is auto-discovered. The delegation graph shows which agent called which.
What's captured automatically
- Zero code changes: two environment variables, existing crew code untouched
- Agent auto-discovery: every CrewAI agent registered in the Agent Registry on first run
- Delegation graph: which agents delegate to which, with cost and latency per hop
- Per-task cost attribution: LLM cost attributed per task and agent role
- Tool call spans: every tool invoked by a crew agent with inputs and outputs
- OTel standard: no proprietary lock-in — standard spans, switchable backend
FAQ
Do I need to modify my crew or agent definitions?
No. The integration works entirely through OpenTelemetry environment variables. Your Crew, Agent, and Task definitions stay exactly as they are.
Does this work with CrewAI's latest versions?
Yes. The OpenTelemetry integration is based on CrewAI's native OTel support, which is maintained by the CrewAI team and updated with each release.
Can I see which crew member is most expensive?
Yes. Open Cost → Attribution and switch the dimension to 'agent'. Each CrewAI agent's LLM spend is attributed separately.
Start for free — 10K traces/month, no card needed
CrewAI integration works on all plans including the free tier.