Pydantic Logfire

https://pydantic.dev/logfire

Logs, traces and metrics-
from local to prod.

See exactly what your Python apps and LLMs are doing, while you code. Built on open standards (OpenTelemetry), Pydantic Logfire offers native AI integrations—from LLM API calls to agent frameworks. Plus comprehensive observability for any workload, AI or not.

Visualise your whole app, not just LLM calls

Pydantic Logfire delivers entire application traces, logs and metrics, not just the LLM calls. You’d be surprised how often the slow-down is found in the seams between tools. You want full visibility, from network calls to database queries to third party APIs. Take the guesswork out of debugging, catch bugs as you code.

INTRODUCING LOGFIRE

A more intuitive way to understand your

Pydantic Logfire is a window into the inner workings of your application. Smooth to set up and easy to understand, with ready integrations for many popular libraries.

Insights

Query your data with full SQL

Query your data with full Postgres flavored SQL — all the control and (for many) nothing new to learn. Even if you don’t like writing SQL, LLMs do, so SQL plus an MCP server lets your IDE use Pydantic Logfire as a window into your app’s execution. Search for obstacles and opportunities, as you (or the AI) writes code.

diagram showing an IDE using MCP server to query Logfire data

From local to prod

See your application traces appear in real time. Spin up Pydantic Logfire in your local development environment and carry it through your entire dev-lifecycle, from initial debugging to production monitoring. The same observability platform that helps you catch bugs as you code keeps your production systems healthy too. No tool switching, no context loss, no friction.

Built on open standards, usable in 3-10 LOC

Pydantic Logfire is built on OpenTelemetry , which you’d expect for a modern observability tool. What you might not expect is how verbose it can be to work directly with OTel’s SDKs, compared to our custom streamlined and ergonomic SDKs for Python, Rust and Typescript. Plus, our SDKs make the live view more powerful, like rendering spans before they’ve completed.

import logfire
logfire.configure()
logfire.info('Hello, {name}!', name='world')

Visibility is more than classic Observability

Beyond devops and responding to incidents, for quality over time you also want integrated analytics. You should be able to use the same view to see exceptions and why a customer downgraded. Or see a chart of payment volume in the same dashboard that shows you a chart of API response times. Pydantic Logfire is flexible and powerful enough to do both so you can understand your code and visualise its impact.

Integrates with the tools you love

Get a robust, consistent view into your application, regardless of your stack.


logfire.instrument_system_metrics()
logfire.instrument_pydantic_ai()
logfire.instrument_pydantic()
logfire.instrument_mcp()
logfire.instrument_fastapi(...)
logfire.instrument_openai()
logfire.instrument_openai_agents()
logfire.instrument_anthropic()
logfire.instrument_httpx()
logfire.instrument_requests()
logfire.instrument_aiohttp_client()
logfire.instrument_django(...)
logfire.instrument_flask(...)
logfire.instrument_starlette(...)
logfire.instrument_asgi(...)
logfire.instrument_wsgi(...)
logfire.instrument_psycopg()
logfire.instrument_asyncpg()
logfire.instrument_sqlite3()
logfire.instrument_redis()
logfire.instrument_mysql()
logfire.instrument_pymongo()
logfire.instrument_sqlalchemy(...)
logfire.instrument_celery()
logfire.instrument_aws_lambda(...)

Logfire is already making developers' lives easier

FOR DEVELOPERS

Ready to start building?

Logfire’s Python SDK is open source under the MIT license and wraps the OpenTelemetry Python package. By default, it will send data to the Logfire platform but you could send data to any OpenTelemetry Protocol (OTLP) compliant endpoint.

{
"by": "ellieh",
"descendants": 79,
"id": 40212490,
"kids": [
40212723,
40218832,
40219139,
40215351,
40216559,
40214627,
40214032,
40214699,
40215008,
40216537,
40216536,
40214894
],
"score": 146,
"time": 1714492570,
"title": "Pydantic Logfire",
"type": "story",
"url": "https://pydantic.dev/logfire"
}
{
"author": null,
"date": null,
"description": "Logfire is a new type of observability platform built on the same belief as Pydantic — that the most powerful tools can be easy to use.",
"image": "https://pydantic.dev/logfire/opengraph-image.jpg?b57901e7917d2d58",
"logo": "https://logo.clearbit.com/pydantic.dev",
"publisher": "Pydantic",
"title": "Pydantic Logfire",
"url": "https://pydantic.dev/logfire"
}
{
"url": "https://pydantic.dev/logfire",
"title": "Pydantic Logfire",
"description": "Logs, traces and metrics-from local to prod.See exactly what your Python apps and LLMs are doing, while you code. Built on open standards (OpenTelemetry), Pydantic Logfire offers native AI integrations—from...",
"links": [
"https://pydantic.dev/logfire"
],
"image": "https://pydantic.dev/logfire/opengraph-image.jpg?b57901e7917d2d58",
"content": "<div><div><h2>Logs, traces and metrics-<br />from local to prod.</h2><p>See exactly what your Python apps and LLMs are doing, while you code. Built on open standards (OpenTelemetry), Pydantic Logfire offers native AI integrations—from LLM API calls to agent frameworks. Plus comprehensive observability for any workload, AI or not.</p></div><div><p>Visualise your whole app, not just LLM calls</p><p>Pydantic Logfire delivers entire application traces, logs and metrics, not just the LLM calls. You’d be surprised how often the slow-down is found in the seams between tools. You want full visibility, from network calls to database queries to third party APIs. Take the guesswork out of debugging, catch bugs as you code.</p></div><div><svg width=\"100%\" height=\"100%\"></svg><div><p>INTRODUCING LOGFIRE</p><h2>A more intuitive way to understand your </h2><p>Pydantic Logfire is a window into the inner workings of your application. Smooth to set up and easy to understand, with ready integrations for many popular libraries.</p></div></div><div><p>Insights</p><div><h3>Query your data with full SQL</h3></div><p>Query your data with full Postgres flavored SQL — all the control and (for many) nothing new to learn. Even if you don’t like writing SQL, LLMs do, so SQL plus an MCP server lets your IDE use Pydantic Logfire as a window into your app’s execution. Search for obstacles and opportunities, as you (or the AI) writes code.</p><p><img alt=\"diagram showing an IDE using MCP server to query Logfire data\" srcset=\"https://pydantic.dev/cdn-cgi/image/width=1920,quality=75,format=auto/https://pydantic.dev/assets/logfire/query-data.png 1x, https://pydantic.dev/cdn-cgi/image/width=3840,quality=75,format=auto/https://pydantic.dev/assets/logfire/query-data.png 2x\" src=\"https://pydantic.dev/cdn-cgi/image/width=3840,quality=75,format=auto/https://pydantic.dev/assets/logfire/query-data.png\" /></p></div><div><div><h2>From local to prod</h2><p>See your application traces appear in real time. Spin up Pydantic Logfire in your local development environment and carry it through your entire dev-lifecycle, from initial debugging to production monitoring. The same observability platform that helps you catch bugs as you code keeps your production systems healthy too. No tool switching, no context loss, no friction.</p></div><div><div><h2>Built on open standards, usable in 3-10 LOC</h2><p>Pydantic Logfire is built on <a target=\"_blank\" href=\"https://opentelemetry.io/docs/what-is-opentelemetry/\">OpenTelemetry</a> , which you’d expect for a modern observability tool. What you might not expect is how verbose it can be to work directly with OTel’s SDKs, compared to our custom streamlined and ergonomic SDKs for Python, Rust and Typescript. Plus, our SDKs make the live view more powerful, like rendering spans before they’ve completed.</p></div><div><pre><code><span>import</span> logfire\nlogfire.configure()\nlogfire.info(<span>'Hello, {name}!'</span>, name=<span>'world'</span>)\n</code></pre></div></div><div><h2>Visibility is more than classic Observability</h2><p>Beyond devops and responding to incidents, for quality over time you also want integrated analytics. You should be able to use the same view to see exceptions and why a customer downgraded. Or see a chart of payment volume in the same dashboard that shows you a chart of API response times. Pydantic Logfire is flexible and powerful enough to do both so you can understand your code and visualise its impact.</p></div><div><div><h2>Integrates with the tools you love</h2><p>Get a robust, consistent view into your application, regardless of your stack.</p></div><div><pre><code>\nlogfire.instrument_system_metrics()\nlogfire.instrument_pydantic_ai()\nlogfire.instrument_pydantic()\nlogfire.instrument_mcp()\nlogfire.instrument_fastapi(...)\nlogfire.instrument_openai()\nlogfire.instrument_openai_agents()\nlogfire.instrument_anthropic()\nlogfire.instrument_httpx()\nlogfire.instrument_requests()\nlogfire.instrument_aiohttp_client()\nlogfire.instrument_django(...)\nlogfire.instrument_flask(...)\nlogfire.instrument_starlette(...)\nlogfire.instrument_asgi(...)\nlogfire.instrument_wsgi(...)\nlogfire.instrument_psycopg()\nlogfire.instrument_asyncpg()\nlogfire.instrument_sqlite3()\nlogfire.instrument_redis()\nlogfire.instrument_mysql()\nlogfire.instrument_pymongo()\nlogfire.instrument_sqlalchemy(...)\nlogfire.instrument_celery()\nlogfire.instrument_aws_lambda(...)\n</code></pre></div></div></div><section><p></p><h2>Logfire is already making developers' lives easier</h2><p></p></section><div><p>FOR DEVELOPERS</p><p>Ready to start building?</p><p>Logfire’s Python SDK is open source under the MIT license and wraps the OpenTelemetry Python package. By default, it will send data to the Logfire platform but you could send data to any OpenTelemetry Protocol (OTLP) compliant endpoint.</p></div></div>",
"author": "",
"favicon": "https://pydantic.dev/favicon/favicon.ico",
"source": "pydantic.dev",
"published": "",
"ttr": 100,
"type": ""
}