← AI GitHub

AI GitHub

Logfire for tracing Python AI applications

Inspect application traces and model calls with OpenTelemetry-based instrumentation.

AI AgentsPublished 2 min read

Key Takeaways

  • Logfire provides instrumentation and integrates with common Python libraries.
  • Install the instrumentation for the part of the application you need to observe.
  • Instrument one run with a synthetic prompt and view the trace across an application function and a tool call.
  • Traces can contain application input and tool output.

How it works

Logfire provides instrumentation and integrates with common Python libraries. Spans show how work such as a model call and a database query fit inside a larger request.

What you need

Install the instrumentation for the part of the application you need to observe. Choose a trace destination and inspect captured attributes before enabling it around model or database calls.

What to try first

Instrument one run with a synthetic prompt and view the trace across an application function and a tool call. Check which attributes are captured before using real data.

Check a trace made by a worker thread or background job. Context propagation can differ from the synchronous code path that works during a demo.

Where to look for failures

Traces can contain application input and tool output. Review capture, redaction, retention and the destination of the telemetry as separate deployment choices.

Related Franklin pages

A gateway tells you where a request went, while instrumentation shows what happened around it. Keep IDs across layers so provider errors can be tied to the original application request.

Browse Franklin for concrete examples of tools and services exposed through MCP. Franklin’s MCP directory

Project documentation

Try it for your workflow

Explore the project’s documentation for setup and usage, or save this page to a collection for later.

Read the project documentation ↗