Repolode
pydantic

pydantic/logfire

Python SDK for Pydantic Logfire, an observability tool that instruments Python apps and LLM agents with OpenTelemetry traces, metrics and logs.

Open-source alternative to:DatadogSentry

Stars
4,518
Forks
325
Open issues
217
Last commit
yesterday

What is it?

Logfire is an observability platform for Python applications, including LLM and agent systems. This repository holds the open-source Python SDK and documentation; the server that stores and displays recorded data is closed source.

The SDK is an opinionated wrapper around OpenTelemetry. You can add manual spans and log messages with simple calls, or instrument supported packages such as FastAPI and database connectors without changing much code. Data can be queried with standard SQL, and the SDK can also export to any OTel-compatible backend.

It also provides Python-specific insight, such as rich display of Python objects, event-loop telemetry, and integration with Pydantic validation models. Install it with pip install logfire, which also installs a CLI for authentication.

Key features

  • 01Manual tracing and logging with simple span and log calls.
  • 02Automatic instrumentation for packages such as FastAPI.
  • 03Supports traces, metrics and logs via OpenTelemetry.
  • 04Data can be queried with standard SQL.
  • 05Exports to any OTel-compatible backend.

Use cases

  • Tracing requests and database calls in a FastAPI service.
  • Monitoring LLM and agent calls in production Python applications.
  • Adding structured logs with Python object context to scripts and services.

Quick start

  1. 1

    Install the Logfire SDK and CLI with pip

    pip install logfire
  2. 2

    Authenticate with Logfire

    logfire auth

Things to know

  • The Logfire server application and dashboard are closed source; only the SDK is open source.
  • Viewing and storing data relies on the hosted or enterprise Logfire platform, which is not open source.

Topics

FAQ

What is logfire?
Python SDK for Pydantic Logfire, an observability tool that instruments Python apps and LLM agents with OpenTelemetry traces, metrics and logs. Logfire is an observability platform for Python applications, including LLM and agent systems. This repository holds the open-source Python SDK and documentation; the server that stores and displays recorded data is closed source.
Is logfire free to use? What license does it have?
logfire is open source under the MIT license. Check the license terms before using it in commercial products.
Is logfire still maintained?
Actively maintained. The last commit to logfire was on Oct 20, 2026.
What can I use logfire for?
Tracing requests and database calls in a FastAPI service. Monitoring LLM and agent calls in production Python applications. Adding structured logs with Python object context to scripts and services.
How do I install logfire?
Install the Logfire SDK and CLI with pip: pip install logfire Authenticate with Logfire: logfire auth
Where can I get logfire?
The source code and installation instructions are on GitHub: https://github.com/pydantic/logfire

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects