Registry / observability / openinference-instrumentation-crewai

openinference-instrumentation-crewai

JSON →
library1.1.10pypypi✓ verified 84d ago

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-crewai
INSTALL
IMPORT
SIG · OPENINFERENCE-INST
O
openinference-instrumentation-crewai
observabilitypythonv1.1.10
Install
2.8s avg
Import
560ms
Disk
23MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 3.1s
py 3.11
✓ —
✓ 3s
py 3.12
✓ —
✓ 2.5s
py 3.13
✓ —
✓ 2.6s
py 3.9
✕ build_error
✕ build_error
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CrewAIInstrumentor
from openinference.instrumentation.crewai import CrewAIInstrumentor

Minimal setup to instrument CrewAI and export spans to console. Replace ConsoleSpanExporter with an OTLP exporter for production.

from opentelemetry import trace from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import SimpleSpanProcessor, ConsoleSpanExporter from openinference.instrumentation.crewai import CrewAIInstrumentor # Set up OTEL tracing trace.set_tracer_provider(TracerProvider()) span_processor = SimpleSpanProcessor(ConsoleSpanExporter()) trace.get_tracer_provider().add_span_processor(span_processor) # Instrument CrewAI CrewAIInstrumentor().instrument() # Now run CrewAI code; spans will be exported to console tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("example"): # Your CrewAI agent/task code here pass
Debug
Known issues
breakingRequires Python 3.10+ and crewai version >=0.30.0. Older crewai versions are not supported and will fail to instrument.
fix
Upgrade crewai to latest version (pip install --upgrade crewai).
affects: <=0.30.0
gotchaMust call instrument() before importing or instantiating crewai components to ensure proper monkey-patching. If instrument() is called after crewai is already loaded, it may not work correctly.
fix
Reorder imports: call instrument() before any crewai imports, or use suppress_imports=True and then import crewai after instrument().
affects: all
deprecatedThe module `openinference_instrumentation_crewai` (underscore style) is deprecated; use `openinference.instrumentation.crewai` (dot style).
fix
Use `from openinference.instrumentation.crewai import CrewAIInstrumentor`.
affects: >=1.0.0
Errors
Common errors & fixes
ImportError: cannot import name 'CrewAIInstrumentor' from 'openinference.instrumentation.crewai'
Old import path using underscore or incorrect package name.
fix
Use `from openinference.instrumentation.crewai import CrewAIInstrumentor`.
opentelemetry.sdk.trace.TraceError: failed to set tracer provider
TracerProvider not set before instrumentation.
fix
Call `trace.set_tracer_provider(TracerProvider())` before `CrewAIInstrumentor().instrument()`.
TypeError: 'NoneType' object is not callable
Instrument() called without setting up a span processor or exporter; spans have no destination.
fix
Add a span processor, e.g., `trace.get_tracer_provider().add_span_processor(SimpleSpanProcessor(ConsoleSpanExporter()))`.
Upgrade
Version history
1.1.10latest on PyPI · released Jun 17, 2026
Audit
Dependencies
openinference-instrumentationrequiredBase instrumentation package providing OpenInferenceSemanticConventions and trace utilities.
crewairequiredInstrumented library; must be installed to use the instrumentation.
wraptrequiredUsed for monkey-patching crewai classes. Version 2.x compatible since recent fix.
Agent activity
24 hits · last 30 days
node
20
OpenAI (training)
2
Amazon
1
Resources
openinference-instrumentation-crewai — pip install openinference-instrumentation-crewai · libregistry