Skip to content

Integrations

If a package you are using is not listed here, please let us know on our Slack!

OpenTelemetry Integrations

Since Pydantic Logfire is OpenTelemetry compatible, it can be used with any OpenTelemetry instrumentation package. You can find the list of all OpenTelemetry instrumentation packages here.

Below you can see more details on how to use Logfire with some of the most popular Python packages.

Package Type
FastAPI Web Framework
Django Web Framework
Flask Web Framework
Starlette Web Framework
ASGI Web Framework Interface
WSGI Web Framework Interface
HTTPX HTTP Client
Requests HTTP Client
AIOHTTP HTTP Client
SQLAlchemy Databases
Asyncpg Databases
Psycopg Databases
PyMongo Databases
MySQL Databases
SQLite3 Databases
Redis Databases
BigQuery Databases
Airflow Task Scheduler
FastStream Task Queue
Celery Task Queue
Stripe Payment Gateway
System Metrics System Metrics

If you are using Logfire with a web application, we also recommend reviewing our Web Frameworks documentation.

Custom Integrations

We have special integration with the Pydantic library and the OpenAI SDK:

Package Type
Pydantic Data Validation
OpenAI AI
Anthropic AI

Logging Integrations

Finally, we also have documentation for how to use Logfire with existing logging libraries:

Package Type
Standard Library Logging Logging
Loguru Logging
Structlog Logging

Creating Custom Integrations

If you are a maintainer of a package and would like to create an integration for Logfire, you can do it! 😄

We've created a shim package called logfire-api, which can be used to integrate your package with Logfire.

The idea of logfire-api is that it doesn't have any dependencies. It's a very small package that matches the API of Logfire. We created it so that you can create an integration for Logfire without having to install Logfire itself.

You can use logfire-api as a lightweight dependency of your own package. If logfire is installed, then logfire-api will use it. If not, it will use a no-op implementation. This way users of your package can decide whether or not they want to install logfire, and you don't need to check whether or not it's installed.

Here's how you can use logfire-api:

import logfire_api as logfire

logfire.info("Hello, Logfire!")

Note

You generally don't want to call logfire_api.configure(), it's up to your users to call logfire.configure() if they want to use the integration.

All the Logfire API methods are available in logfire-api.