CrewAI monitoring: catch the crew run that loops and still finishes
CrewAI monitoring from your crew's own traces. Send each kickoff to Amiril over OpenTelemetry, find the runs that stood out by rarity and triage them as issues.
CrewAI monitoring from your crew's own traces. Send each kickoff to Amiril over OpenTelemetry, find the runs that stood out by rarity and triage them as issues.
In a CrewAI forum thread on runaway tool calls, one reply describes a shopping agent that called open_url with the identical search URL more than ten times and ended with an empty answer. If your crew kicks off thousands of times a week, CrewAI monitoring has to surface that one run without anyone opening the rest. We built Amiril to find that run from the crew's own traces. It ranks every kickoff against that agent's earlier runs and groups the runs that share a problem into one issue.
The example crew here researches a company and drafts an outreach email. An Account Researcher agent has a fetch_page tool, and an Email Writer turns its notes into a draft.
Amiril takes a crew's traces over OpenTelemetry, recorded by two packages from OpenInference, Arize's open-source set of instrumentations. The CrewAI one records the crew, its agents and their tool calls, and the OpenAI one records the model calls.
pip install openinference-instrumentation-crewai openinference-instrumentation-openai opentelemetry-sdk opentelemetry-exporter-otlp-proto-http
from openinference.instrumentation.crewai import CrewAIInstrumentor from openinference.instrumentation.openai import OpenAIInstrumentor from opentelemetry import trace from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor provider = TracerProvider() provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter())) trace.set_tracer_provider(provider) CrewAIInstrumentor().instrument(tracer_provider=provider) OpenAIInstrumentor().instrument(tracer_provider=provider)
Run that once at startup, before the first kickoff. The exporter reads the standard variables, and the endpoint and API key both come from the Data page in Amiril:
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="<OpenTelemetry traces endpoint>" export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL="http/protobuf" export OTEL_EXPORTER_OTLP_TRACES_HEADERS="Authorization=Bearer <your API key>"
If your agents call a model through another provider's client, add OpenInference's instrumentation for that client beside the OpenAI one. The CrewAI traces guide has the steps for creating the key.
CrewAI's telemetry page (as of December 2026) offers OTEL_SDK_DISABLED=true as a way to switch off its anonymous usage telemetry, and notes that it disables all OpenTelemetry instrumentation in the process. With crewai 1.15.48 and that variable set, the provider above recorded zero spans, so no run ever shows up. Use CREWAI_DISABLE_TELEMETRY=true to turn off CrewAI's telemetry and leave the OpenTelemetry SDK alone.
Each kickoff arrives as one run, with the Email Writer's steps in the same run as the researcher's. The run takes its agent name from the role of the crew member that starts first, so this crew shows up as Account Researcher.
That role also decides which earlier runs each kickoff is compared with. Amiril learns what is normal for an agent only from that agent's own earlier runs, and a CrewAI role can hold placeholders. Write role="{company} Account Researcher" and CrewAI fills it in at kickoff. Kick off with inputs={"company": "Example Co"} and the agent span carries the role as "Example Co Account Researcher". In Amiril every company would then be a separate agent. Keep the role fixed and put the company in the task description, so every kickoff joins one agent's history.
With a fixed role, the looping run's page shows a rarity factor saying it called fetch_page more times than any of the agent's 640 earlier runs:
fetch_page was called 11 times in this run, above all 640 runs.
That rarity factor is measured in bits from this agent's own history, and the run's three strongest add up to its rarity. The run page shows it as a standing such as "Top 1%", against every run of every agent in the environment over the last 30 days. Hover it for the bits, such as 11.4. You decide how many runs you want to look at in a week, and that review budget sets the bar a run has to clear to be marked Anomaly.
Some agents fetch a lot of pages for good reasons. When a flagged run turns out to be fine, mark it as normal. Mark two runs with 12 and 14 fetches as normal, and the fetch count goes Quiet for this agent: it stops counting toward the rarity, unless someone confirmed a run where it was one of the strongest. A later run with 30 fetches is rarer than both, so it still counts.
CrewAI already gives you a ceiling. As of December 2026 its Agent settings include max_iter, which defaults to 20, plus max_rpm and max_execution_time. The forum reply that pointed to that shopping agent called these caps the right way to stop spend, so set them on both agents in this crew. The looping run above called fetch_page 11 times, well under the default of 20, so it finished without the cap ever firing.
CrewAI tracing is the other half of what ships with the framework. Set tracing=True on a Crew or Flow, or CREWAI_TRACING_ENABLED=true, and each execution uploads to CrewAI AMP. Its Traces tab (as of December 2026) shows agent decisions, a task timeline, tool usage and model calls, with times, tokens and costs. CrewAI's observability overview also lists third-party tracers, Langfuse, Arize Phoenix, MLflow, Opik and Weave among them. The same overview's advice for production includes "Monitor for anomalies and degradation".
Those viewers show one open trace in detail. In CrewAI monitoring the first question is which of a week's traces to open, and Amiril's Anomalies page answers it with the kickoffs waiting for your review, rarest first. Our agent observability piece makes the longer case for starting from that list.
Thirty looping runs in a week on the same agent, all with the same strongest rarity factor, land in one issue. A rarity issue forms once three runs share the problem, or as soon as you confirm one. Its Runs per day chart shows whether the loop is getting more common. Amiril's investigator reads a sample of the runs and writes up what they share under "What is happening".
Other problems start an issue from a single run. The one we'd watch on this crew is the Email Writer inventing numbers. If the draft says the company raised $40 million and no fetch_page result contains that figure, the grounding check flags the run with "Stated a value no tool result or earlier message contains". A grounding check issue is Critical. It reads what the agents said, from the model calls the OpenAI instrumentor records.
Amiril also writes a one-sentence summary of each kickoff and groups similar runs into run topics. On a research crew you would expect topics like "Researches the company and drafts an email". If one forms around research that ended with no usable notes, label it Bad, and every run in it joins one High issue.
If you run CrewAI in production and connect Slack, a grounding check issue like that one posts to your channel as soon as it forms, because every new issue at High or above gets a message. The digest at 08:00 UTC is for slower trouble: open issues that came back, grew or are rising. Each channel has its own switches on the alerts page, so the digest can go to one channel and new issues to another.
Once you know what the bad call looks like, you can describe it as a rule. This one flags a fetch_page call when the same URL was already fetched twice in the run:
@id("same-page-again")
@sentence("fetch_page already fetched {url} twice in this run")
flag (
agent == "Account Researcher",
tool == "fetch_page"
)
when {
len(calls(fetch_page[status == "any"]{args.url == call.args.url})) >= 2
};status == "any" counts earlier calls that failed as well as ones that succeeded, since a retry storm is often a string of failures. A published rule starts in Shadow. Every call still runs, and the rule only records the ones it would have flagged; since it needs no history or review budget, it catches the third fetch of a URL even in the agent's first run. Its page counts the calls it would have fired on in the last 24 hours, worked out from the traces you already send. Test on past calls replays any version of it, an unpublished draft included, over the last 24 hours, 7 days or 30 days. Often you won't need to write it at all, because an issue's page can carry a rule suggestion with the rule already drafted.
Before you set up CrewAI monitoring on a real crew, look at the role of the agent whose task runs first: a fixed role keeps every kickoff in one history. To send your own crew's kickoffs, follow the CrewAI traces guide.