Skip to main content
CrewAI is a Python framework for orchestrating role-playing autonomous agents — agents collaborate on tasks, hand off work, and call tools. Arize AX captures every CrewAI run — Crew / Agent / Task spans plus the underlying LLM calls — via the openinference-instrumentation-crewai package, paired with an LLM-level instrumentor matching the provider CrewAI routes to.

CrewAI Tracing Tutorial (Google Colab)

Prerequisites

  • Python 3.10+
  • An Arize AX account (sign up)
  • An OPENAI_API_KEY from the OpenAI Platform
  • CrewAI 1.0+ (this guide uses the native-SDK routing model introduced in 1.0; for 0.x see Troubleshooting)

Launch Arize AX

  1. Sign in to your Arize AX account.
  2. From Space Settings, copy your Space ID and API Key. You will set them as ARIZE_SPACE_ID and ARIZE_API_KEY below.

Install

CrewAI 1.0+ routes LLM calls based on the model-string prefix: openai/... and bare model names go to the native OpenAI SDK, anthropic/... goes to Anthropic, etc. The LLM-level instrumentor must match the provider CrewAI is actually calling. The example below uses openai/gpt-5.5 so it pairs openinference-instrumentation-crewai with openinference-instrumentation-openai. Other prefixes need a different pairing — see Which instrumentor do I need? below.

Which instrumentor do I need?

CrewAI 1.0+ routes LLM calls to different provider SDKs based on your model string. Match your LLM-level instrumentor to the provider CrewAI is actually calling: The CrewAI instrumentor (openinference-instrumentation-crewai) is always required regardless of provider — it captures Crew, Agent, and Task spans.

Configure credentials

Setup tracing

Run CrewAI

Expected output

Verify in Arize AX

  1. Open your Arize AX space and select project crewai-tracing-example.
  2. You should see a new trace within ~30 seconds with this shape: a Crew_<uuid>.kickoff root span (CHAIN) wraps Crew Created, per-agent <role>._execute_core (AGENT), and per-task Task Created / Task Execution spans. Each task’s Task Execution wraps a ChatCompletion LLM span (model gpt-5.5, with prompt, response, and token usage attached).
  3. If no traces appear, see Troubleshooting.

Check from the skill, CLI, or SDK

Confirm spans are actually reaching your Arize AX project. Use whichever fits your workflow — the skill and CLI work for any framework; the SDK check is shown for each language.
Install the Arize Skills plugin and let your coding agent check for you:
Then prompt your agent:
Use the arize-trace skill to export and analyze recent traces from my project. Confirm spans are arriving, and summarize any errors or latency issues.

Troubleshooting

  • No traces in Arize AX. Confirm ARIZE_SPACE_ID and ARIZE_API_KEY are set in the same shell that runs example.py. Enable OpenTelemetry debug logs with export OTEL_LOG_LEVEL=debug and re-run.
  • Crew / Agent / Task spans appear but no LLM spans. The LLM-level instrumentor doesn’t match the provider CrewAI is calling. CrewAI 1.0+ routes by model-string prefix:
    • openai/<model> (or no prefix) → install openinference-instrumentation-openai
    • anthropic/<model> → install openinference-instrumentation-anthropic
    • Groq / Together / providers without a native CrewAI SDK → install openinference-instrumentation-litellm (CrewAI falls back to LiteLLM for these)
  • All spans missing — no Crew, no LLM. This is almost always import order. CrewAIInstrumentor().instrument(...) and the LLM-level instrumentor both monkey-patch class methods or module functions; if crewai (or the LLM library) is imported before instrument() runs, the patches land on stale references and never fire. Make sure instrumentation.py is the first import in your entry point — and watch for transitive imports (importing your own crew.py module that has from crewai import ... at the top has the same effect).
  • 401 from OpenAI. Verify OPENAI_API_KEY is set and has access to gpt-5.5. Swap openai/gpt-5.5 in LLM(model=...) for a model your key can call.
  • Version-check error from CrewAIInstrumentor. If you’re on a CrewAI release candidate that’s outside the instrumentor’s supported range, escape-hatch with CrewAIInstrumentor().instrument(skip_dep_check=True, tracer_provider=tracer_provider).
  • You’re on CrewAI 0.x. 0.x routes every LLM call through LangChain or LiteLLM rather than provider-native SDKs. Pair the CrewAI instrumentor with both openinference-instrumentation-langchain and openinference-instrumentation-litellm instead of openinference-instrumentation-openai. The Setup tracing call list becomes CrewAIInstrumentor().instrument(...) + LangChainInstrumentor().instrument(...) + LiteLLMInstrumentor().instrument(...). Upgrade to 1.0+ when you can — the LiteLLM removal guide covers the migration.

Resources

CrewAI Documentation

CrewAI LLM Provider Routing

OpenInference CrewAI Instrumentor

CrewAI GitHub