CrewAI
Trace CrewAI crews, agents, tasks, LLM calls, and tools through the global event listener.
The CrewAI integration listens to CrewAI's event bus and records crew, agent, task, LLM, tool, and supported workflow events. It observes the existing application without being assigned to an individual Crew instance.
Requirements
- Python 3.10 or later
- CrewAI 0.177.0 or later
- an existing working crew
Install only the tracing package in the CrewAI application:
pip install noveum-traceInitialize and register the listener
Initialize Noveum Trace first, then create the listener before calling kickoff():
import os
import noveum_trace
from noveum_trace.integrations.crewai import setup_crewai_tracing
noveum_trace.init(
api_key=os.environ["NOVEUM_API_KEY"],
project=os.environ["NOVEUM_PROJECT"],
environment=os.getenv("NOVEUM_ENVIRONMENT", "production"),
service_version=os.environ["NOVEUM_SERVICE_VERSION"],
)
listener = setup_crewai_tracing()
try:
result = crew.kickoff(inputs={"topic": topic})
finally:
listener.shutdown()
noveum_trace.flush()Creating the listener registers its handlers globally. Do not assign it to crew.callback_function or another crew field.
For a long-running service, register one listener during startup and call listener.shutdown() during graceful shutdown. For a short-lived script or test, the try and finally pattern ensures the listener and span exporter finish cleanly.
Control payload capture
CrewAI events can contain task inputs, agent output, model messages, tool schemas and results, memory, and knowledge context. Disable capture categories before processing sensitive data:
listener = setup_crewai_tracing(
capture_inputs=False,
capture_outputs=False,
capture_llm_messages=False,
capture_tool_schemas=False,
capture_memory=False,
capture_knowledge=False,
)Disabling one category does not redact another. Review a representative trace and confirm the remaining CrewAI event payloads comply with your data policy.
Never send credentials, authorization headers, private keys, or secrets through task inputs, tool arguments, metadata, or outputs.
What is captured
The listener records supported events emitted by the CrewAI version in the application:
| Operation | Typical evidence |
|---|---|
| Crew kickoff and completion | Inputs, final output, timing, status, and crew snapshot when enabled |
| Agent and task execution | Agent role, goal, task assignment, output, timing, and errors |
| LLM calls | Messages, generations, model metadata, reported usage, and errors |
| Tool calls | Tool name, schema, arguments, result, timing, and errors |
| Optional CrewAI features | Memory, knowledge, flow, delegation, MCP, guardrail, and streaming events when emitted and enabled |
Event availability depends on the installed CrewAI version and features in use. Validate actual trace payloads before configuring ETL or scorers.
Verify the integration
Run a crew with at least one model call and tool call, then confirm:
- the crew kickoff owns the complete trace
- agent and task spans preserve execution order
- model spans contain the messages, output, model identity, and usage
- tool spans contain the schema, arguments, result, and errors
- the final crew output and terminal status are present
- the trace carries the expected environment and service version
For field-level requirements, use the evaluation capture contract. For custom operations outside CrewAI events, use the Python SDK.
