Skip to content

Overview

See every decision your agent makes and everything it triggers. Tell a prompt problem from a service problem before you change production.

Logfire turns an agent run into one trace (the full journey of one request or agent run, made of nested spans): the model calls, tool calls, database queries, API requests, and response your user receives.

An agent trace with model, tool, and database workA complete agent run: the agent calls a model, then an inventory tool, which queries a database, before the agent returns a response. The database span is visibly slow, showing why full-stack context matters.trace · inventory-agent.runsample runAgentLLMToolDatabaseinventory-agent.runmodel.generate1.8k tokenssearch_inventorySELECT inventory1.2 sHere’s what happenedOne trace gives you evidence to investigate a wrong or slow answer.

Before you explore: this page explains what Logfire can show once your application is sending traces. Send your first trace →

Follow the complete agent loop

  • Inspect a single run

    Read the messages, model settings, tool arguments, results, tokens, cost, and latency that produced one answer.

  • See the work behind each tool

    Follow a tool call into the database, API, queue, or service it touched. The trace keeps the causal chain intact.

  • Find expensive or unreliable paths

    Compare models and agent runs by cost, error rate, latency, tokens, tool calls, and turns. Then drill into the trace.

From a bad answer to a useful diagnosis

An agent recommends an item that cannot arrive by Friday. The trace can show two very different failures.

  • The agent never passed the delivery constraint to search_inventory. That is a prompt, model, or tool-selection problem.
  • The agent passed the constraint, but the inventory service returned stale delivery data. That is a system problem.

Both failures look like a bad answer to the user. They need different fixes. Logfire keeps the agent’s decisions and the work they triggered in the same trace, so you can change the right part of the system.

Improve the next run with evidence

Instrument the stack you have

Start with a one-line integration for Pydantic AI, OpenAI, Anthropic, LangChain, or another supported framework. Logfire also accepts OpenTelemetry (OTel), the open industry standard for collecting traces, metrics, and logs, so a TypeScript frontend, Python agent service, and Go backend can all appear in the same trace.

See all integrations →

Control cost and routing (optional)

To cap what your app can spend on models, fail over between providers, or keep one API key for many models, route your calls through the AI Gateway. This is optional: the instrumentation above is all you need to trace and debug your agents.