CrewAI monitoring and observability
See every crew, task and tool call, which agent spent what, and why a run failed. On your own machines.
What you get
- Crews, flows, agents, tasks, tools, and memory and knowledge queries become spans.
- Every model call priced, across 45+ providers, and attributed to the step it ran in.
- The function, file and line behind each call.
- Failed and retried runs, with the error and the step that raised it.
- Cost split by agent or tool, and budgets on either.
- Quality checks scored on every finished run.
- crewReport crew$0.0671
- agentResearcher$0.0420
- taskFind competitors8.2s
- toolSerperDevTool1.4s
- agentWriter$0.0251
- taskDraft report6.0s
1. Start CostKey
Run it on your own machines. Open http://localhost:4100, sign up and copy your project's DSN.
bash
curl -fsSL https://costkey.dev/install.sh | sh2. Install the SDK
bash
pip install "costkey[crewai]"Python
import os
import costkey
costkey.init(dsn=os.environ["COSTKEY_DSN"])3. Add the CrewAI integration
Python
from costkey.integrations.crewai import CostKeyCrewAIListener
listener = CostKeyCrewAIListener() # registers on crewai_event_bus
crew.kickoff()Keep a reference to the listener for as long as the crew runs.
Full reference: CrewAI in the docs.
Questions
Can I budget one agent in a crew?
Yes. Calls inside an agent span carry the agent name, so a budget can cover a single agent or tool.
Does it work with CrewAI Flows?
Yes. Flows and their steps become spans too.
Try it on your own machines
One command starts Postgres, the server and the console with Docker.
bash
curl -fsSL https://costkey.dev/install.sh | sh