Documentation Index
Fetch the complete documentation index at: https://docs.trulayer.ai/llms.txt
Use this file to discover all available pages before exploring further.
Install
Instrument
instrument_crewai wraps a single Crew instance. Call it once per crew — after construction, before kickoff().
What gets captured
- A
crewroot span around everykickoff()call, with theinputsas span input and the final crew result as output. - One
agentchild span per agent task execution, nested under the crew span. toolspans for any@tool-decorated functions invoked by an agent.- LLM calls inside agents produce
llmspans when the underlying provider (OpenAI, Anthropic, etc.) is also instrumented — combine withinstrument_openai/instrument_anthropic.
Known gotchas
- One crew, one call. Each
instrument_crewaicall binds to a specificCrewinstance. Re-instrumenting the same crew is a no-op; instantiating a new crew requires a new call. - Trace context is required. Unlike
instrument_openai, this function needs an activeTraceContextpassed in — call it inside awith trulayer.trace(...)block or pass an explicit trace. - Parallel tasks. When
Crew(process="hierarchical")runs tasks in parallel, span parent-child order still reflects the logical task graph (not wall-clock nesting).