datarobot_genai.crewai.telemetry
telemetry
Idempotent CrewAI auto-instrumentation for agent telemetry.
The released opentelemetry-instrumentation-crewai only instruments CrewAI's
synchronous execution path (kickoff -> Agent.execute_task ->
Task.execute_sync -> LLM.call). CrewAI's native async path
(akickoff -> Agent.aexecute_task -> Task.aexecute_sync ->
LLM.acall) is uninstrumented, so agents driven via akickoff emit no
framework spans.
Until async support lands upstream, :class:DataRobotCrewAIInstrumentor adds
the async wrappers on top of the released synchronous instrumentor, reusing the
released module's span helpers so span shape stays identical across both paths.
TODO (BUZZOK-31424): remove :class:DataRobotCrewAIInstrumentor and the async wrappers once
opentelemetry-instrumentation-crewai ships native akickoff
instrumentation, and revert to instantiating CrewAIInstrumentor directly.
https://github.com/traceloop/openllmetry/pull/4342
DataRobotCrewAIInstrumentor
Bases: CrewAIInstrumentor
CrewAIInstrumentor extended with async execution-path (akickoff) wrappers.
The synchronous wrapping is delegated to the released base class; this subclass adds wrappers for CrewAI's native async methods. Each async method is wrapped defensively so instrumentation still succeeds on CrewAI releases that predate a given method.
Source code in datarobot_genai/crewai/telemetry.py
instrument
Idempotently enable CrewAI instrumentation, including the async path.