We run a crew of four AI agents once, and inspect its logs, metrics and trace. We then show several cases, such as a slow search tool, or a model reply that never comes.
The crew and its task
The crew gets a topic, such as "EV sales in Israel, 2026", and returns a short brief on it: a page of facts with their sources.
- planner: splits the topic into a few questions the brief must answer.
- researcher: searches the web for answers with its tool,
web_search, and picks the useful results. - writer: writes the brief from the researcher's findings.
- reviewer: checks the brief against the findings and approves it.
Each agent's output is the next agent's input, so the four work in order, one after another, and each run of the crew handles one topic.
Agents, tasks and runs in CrewAI
An agent in CrewAI is a configuration, not code of its own; the work it does comes from the task it is given (CrewAI 1.15).
- Agent: a
role, a
goal, a
backstory, a model (
llm) and its
tools.- Every agent runs the same loop, CrewAI's agent executor: call the model, run the tool it asks for, call it again, until it answers.
- The tools are code; the agent is not.
- Task: a
description, an
expected_output and the
agent that does it.- One agent may be given several tasks.
- Process: how the crew goes through its tasks.
- Run: one call to
crew.kickoff(), from the topic to the brief.- A run may visit an agent many times, as a manager's does.
- CrewAI calls it a kickoff; OpenTelemetry and Jaeger a trace, named by its trace ID.
- In logging in general, an ID written on every line of one request is a correlation ID: the trace ID serves as one.
- A session or thread is one level up: a conversation of several runs (Langfuse, LangSmith, LangGraph).
- Runs overlap, agents do not. Inside a run, the agents work one at a time.
- The service takes several requests at once, so runs A and B work side by side, and their log lines alternate.
- A log line names its agent, but not its run.
Logs, metrics and traces
While the crew works on one task, one brief, the service captures that work three ways.
- Logs: lines of text the program writes as it works.
- Metrics: numbers it keeps, such as counts and durations, read by Prometheus every 15 seconds.
- Traces: one run's work as a tree of spans, drawn by Jaeger.
Reading the drawing
- The crew, top: one Python service with four agents, planner, researcher, writer and reviewer.
- Requests, left: each run of the crew, lettered by us; the service gives a run no name.
- Each agent lists what it is doing, per run.
- Model API and Search API, right: what the agents call.
- Logs, bottom left: the service's output, every run's lines in one stream.
- Metrics, middle: the values Prometheus scraped last, and each agent's task duration (95th percentile).
- Traces, right: the trace of one run.
- A dashed bar is a span still open in the program, not yet sent to Jaeger.
- Gaps, the bottom row: what each of the three leaves out, and the viewer that fills it.
The story
- One run: run A, from request to brief, with run B beside it.
- A slow search: the search API slows down. Logs, metrics and the trace each show it differently.
- A hung agent: a model call never returns. Logs, metrics and the trace each show it only by what is missing.