Integration

CrewAI observability — drop-in. ~5 minutes.

See the crew, see the tasks, see the hand-offs. CrewAI agents and their delegations appear as a connected trace, not isolated LLM calls. Built on OpenTelemetry GenAI Semantic Conventions.

What we capture for CrewAI

  • Each crew member's task lifecycle: assigned, in-progress, complete
  • Delegation events: which agent handed off to which, and why
  • Tool calls per crew member with args and outputs
  • Inter-agent message passing as connected spans
  • Token + cost roll-up per crew member and per crew run
  • Sequential vs hierarchical process topology

Install

shell
# Python
pip install trefur-observe crewai

export TREFUR_API_KEY=trf_obs_REPLACE_ME

Instrument

crew.py
from trefur_observe import TrefurObserve, patch_crewai
from crewai import Agent, Task, Crew, Process

obs = TrefurObserve.init(api_key="trf_obs_...")
patch_crewai(obs)

researcher = Agent(
    role="Researcher",
    goal="Find competitive pricing for AI observability",
    backstory="Skilled at finding pricing pages and reading them carefully.",
    verbose=True,
)
writer = Agent(
    role="Writer",
    goal="Write a one-page competitive brief",
    backstory="Concise. Cites sources.",
    verbose=True,
)

research_task = Task(
    description="Find pricing for three AI observability products.",
    agent=researcher,
    expected_output="Pricing table with sources.",
)
write_task = Task(
    description="Write a one-page competitive brief from the research.",
    agent=writer,
    expected_output="Markdown brief, 300-500 words.",
)

crew = Crew(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    process=Process.sequential,
)

crew.kickoff()
# Trace appears in https://app.trefur.com with hand-off topology.

What a CrewAI trace looks like

crew · competitive-brief · 12.4s · $0.0822 agents · 6 spans
$ crew.kickoff [root] 12400ms
$ task Researcher.research_task in 14kt out 2.1kt 6.2s
$ tool web_search(...) 3 results 1.1s
$ hand-off Researcher → Writer context 2.1kt
$ task Writer.write_task in 2.4kt out 0.8kt 4.9s
$ return '# Competitive brief\n...'

Three common CrewAI pain points, and what Trefur shows you

Lost context between hand-offs

When the researcher hands off to the writer, has the right context come through? Trefur shows the exact bytes that crossed the boundary so you can see what the next agent saw.

Crew runs that hang on one member

One agent loops on a tool that keeps returning empty results. Trefur surfaces it by agent + task — so you can see the bottleneck before the timeout fires.

Cost concentration on one role

The writer reads the full research context each iteration and inflates the token bill. Trefur attributes tokens to the role so you can shorten the hand-off or summarise first.

FAQ

Sequential and hierarchical processes both?+

Yes. The process topology becomes the trace topology — sequential renders as a chain, hierarchical as a tree.

Custom tools?+

Custom CrewAI tools are auto-instrumented when they inherit from BaseTool. You see args, return value, and exceptions in the trace.

What about LLM provider choice?+

Whatever CrewAI uses under the hood — OpenAI, Anthropic, Bedrock, Gemini — Trefur sees the LLM call and attributes the cost.

Memory and context windows?+

Crew memory is captured as named events on the span. You can replay the context the agent had when it made a decision.

Ship CrewAI agents you can debug.

Free tier. No card required. First trace in under five minutes.