OpenTelemetry instrumentation for CrewAI agents and tasks, enabling distributed tracing and observability via the OpenInference semantic conventions. Version 1.1.3, supports Python 3.10 to 3.13, part of the Arize AI openinference ecosystem. Released as needed alongside crewai updates.
pip install openinference-instrumentation-crewaiVerified import paths — ran on the pinned version, not inferred.
Minimal setup to instrument CrewAI and export spans to console. Replace ConsoleSpanExporter with an OTLP exporter for production.
Upgrade crewai to latest version (pip install --upgrade crewai).
Reorder imports: call instrument() before any crewai imports, or use suppress_imports=True and then import crewai after instrument().
Use `from openinference.instrumentation.crewai import CrewAIInstrumentor`.
Use `from openinference.instrumentation.crewai import CrewAIInstrumentor`.
Call `trace.set_tracer_provider(TracerProvider())` before `CrewAIInstrumentor().instrument()`.
Add a span processor, e.g., `trace.get_tracer_provider().add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter()))`.