pydantic/logfire
Fork: 66 Star: 2206 (更新于 2024-11-27 06:51:18)
license: MIT
Language: Python .
Uncomplicated Observability for Python and beyond! 🪵🔥
最后发布版本: v0.47.0 ( 2024-07-21 00:53:06)
Pydantic Logfire — Uncomplicated Observability
From the team behind Pydantic, Logfire is an observability platform built on the same belief as our open source library — that the most powerful tools can be easy to use.
What sets Logfire apart:
- Simple and Powerful: Logfire's dashboard is simple relative to the power it provides, ensuring your entire engineering team will actually use it.
- Python-centric Insights: From rich display of Python objects, to event-loop telemetry, to profiling Python code and database queries, Logfire gives you unparalleled visibility into your Python application's behavior.
- SQL: Query your data using standard SQL — all the control and (for many) nothing new to learn. Using SQL also means you can query your data with existing BI tools and database querying libraries.
- OpenTelemetry: Logfire is an opinionated wrapper around OpenTelemetry, allowing you to leverage existing tooling, infrastructure, and instrumentation for many common Python packages, and enabling support for virtually any language.
- Pydantic Integration: Understand the data flowing through your Pydantic models and get built-in analytics on validations.
See the documentation for more information.
Feel free to report issues and ask any questions about Logfire in this repository!
This repo contains the Python SDK for logfire
and documentation; the server application for recording and displaying data is closed source.
Using Logfire
This is a very brief overview of how to use Logfire, the documentation has much more detail.
Install
pip install logfire
Authenticate
logfire auth
Manual tracing
Here's a simple manual tracing (aka logging) example:
import logfire
from datetime import date
logfire.info('Hello, {name}!', name='world')
with logfire.span('Asking the user their {question}', question='age'):
user_input = input('How old are you [YYYY-mm-dd]? ')
dob = date.fromisoformat(user_input)
logfire.debug('{dob=} {age=!r}', dob=dob, age=date.today() - dob)
Integration
Or you can also avoid manual instrumentation and instead integrate with lots of popular packages, here's an example of integrating with FastAPI:
import logfire
from pydantic import BaseModel
from fastapi import FastAPI
app = FastAPI()
logfire.configure()
logfire.instrument_fastapi(app)
# next, instrument your database connector, http library etc. and add the logging handler
class User(BaseModel):
name: str
country_code: str
@app.post('/')
async def add_user(user: User):
# we would store the user here
return {'message': f'{user.name} added'}
Logfire gives you a view into how your code is running like this:
Contributing
We'd love anyone interested to contribute to the Logfire SDK and documentation, see the contributing guide.
Reporting a Security Vulnerability
See our security policy.
最近版本更新:(数据更新于 2024-09-13 23:59:38)
2024-07-21 00:53:06 v0.47.0
2024-07-06 00:54:46 v0.46.1
2024-07-05 20:04:39 v0.46.0
2024-07-01 20:07:17 v0.45.1
2024-06-29 20:49:38 v0.45.0
2024-06-26 22:45:16 v0.44.0
2024-06-24 19:23:08 v0.43.0
2024-06-12 01:04:26 v0.42.0
2024-06-07 01:55:13 v0.41.0
2024-06-05 02:15:24 v0.40.0
主题(topics):
fastapi, logging, metrics, observability, openai, opentelemetry, pydantic, python, trace
pydantic/logfire同语言 Python最近更新仓库
2024-12-22 09:03:32 ultralytics/ultralytics
2024-12-21 13:26:40 notepad-plus-plus/nppPluginList
2024-12-21 11:42:53 XiaoMi/ha_xiaomi_home
2024-12-21 04:33:22 comfyanonymous/ComfyUI
2024-12-20 18:47:56 home-assistant/core
2024-12-20 15:41:40 jxxghp/MoviePilot