logfire


Namelogfire JSON
Version 2.8.0 PyPI version JSON
download
home_pageNone
SummaryThe best Python observability tool! 🪵🔥
upload_time2024-12-18 11:33:58
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pydantic Logfire — Uncomplicated Observability

[![CI](https://github.com/pydantic/logfire/actions/workflows/main.yml/badge.svg?event=push)](https://github.com/pydantic/logfire/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)
[![codecov](https://codecov.io/gh/pydantic/logfire/graph/badge.svg?token=735CNGCGFD)](https://codecov.io/gh/pydantic/logfire)
[![pypi](https://img.shields.io/pypi/v/logfire.svg)](https://pypi.python.org/pypi/logfire)
[![license](https://img.shields.io/github/license/pydantic/logfire.svg)](https://github.com/pydantic/logfire/blob/main/LICENSE)
[![versions](https://img.shields.io/pypi/pyversions/logfire.svg)](https://github.com/pydantic/logfire)

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](https://logfire.pydantic.dev/docs/) 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](https://logfire.pydantic.dev/docs/) has much more detail.

### Install

```bash
pip install logfire
```
[_(learn more)_](https://logfire.pydantic.dev/docs/guides/first_steps/#install)

## Authenticate

```bash
logfire auth
```
[_(learn more)_](https://logfire.pydantic.dev/docs/guides/first_steps/#authentication)

### Manual tracing

Here's a simple manual tracing (aka logging) example:

```python
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)
```
[_(learn more)_](https://logfire.pydantic.dev/docs/guides/onboarding-checklist/add-manual-tracing/)

### Integration

Or you can also avoid manual instrumentation and instead integrate with [lots of popular packages](https://logfire.pydantic.dev/docs/integrations/), here's an example of integrating with FastAPI:

```py
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'}
```
[_(learn more)_](https://logfire.pydantic.dev/docs/integrations/fastapi/)

Logfire gives you a view into how your code is running like this:

![Logfire screenshot](https://logfire.pydantic.dev/docs/images/index/logfire-screenshot-fastapi-200.png)

## Contributing

We'd love anyone interested to contribute to the Logfire SDK and documentation, see the [contributing guide](https://github.com/pydantic/logfire/blob/main/CONTRIBUTING.md).

## Reporting a Security Vulnerability

See our [security policy](https://github.com/pydantic/logfire/security).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "logfire",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Pydantic Team <engineering@pydantic.dev>, Samuel Colvin <samuel@pydantic.dev>, Hasan Ramezani <hasan@pydantic.dev>, Adrian Garcia Badaracco <adrian@pydantic.dev>, David Montague <david@pydantic.dev>, Marcelo Trylesinski <marcelo@pydantic.dev>, David Hewitt <david.hewitt@pydantic.dev>, Alex Hall <alex@pydantic.dev>",
    "download_url": "https://files.pythonhosted.org/packages/23/25/d5f4bf06441540f0c8dc350271d8a76fb733a7d4cf9c79d4188469d55b82/logfire-2.8.0.tar.gz",
    "platform": null,
    "description": "# Pydantic Logfire \u2014 Uncomplicated Observability\n\n[![CI](https://github.com/pydantic/logfire/actions/workflows/main.yml/badge.svg?event=push)](https://github.com/pydantic/logfire/actions?query=event%3Apush+branch%3Amain+workflow%3ACI)\n[![codecov](https://codecov.io/gh/pydantic/logfire/graph/badge.svg?token=735CNGCGFD)](https://codecov.io/gh/pydantic/logfire)\n[![pypi](https://img.shields.io/pypi/v/logfire.svg)](https://pypi.python.org/pypi/logfire)\n[![license](https://img.shields.io/github/license/pydantic/logfire.svg)](https://github.com/pydantic/logfire/blob/main/LICENSE)\n[![versions](https://img.shields.io/pypi/pyversions/logfire.svg)](https://github.com/pydantic/logfire)\n\nFrom the team behind Pydantic, **Logfire** is an observability platform built on the same belief as our\nopen source library \u2014 that the most powerful tools can be easy to use.\n\nWhat sets Logfire apart:\n\n- **Simple and Powerful:** Logfire's dashboard is simple relative to the power it provides, ensuring your entire engineering team will actually use it.\n- **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.\n- **SQL:** Query your data using standard SQL \u2014 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.\n- **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.\n- **Pydantic Integration:** Understand the data flowing through your Pydantic models and get built-in analytics on validations.\n\nSee the [documentation](https://logfire.pydantic.dev/docs/) for more information.\n\n**Feel free to report issues and ask any questions about Logfire in this repository!**\n\nThis repo contains the Python SDK for `logfire` and documentation; the server application for recording and displaying data is closed source.\n\n## Using Logfire\n\nThis is a very brief overview of how to use Logfire, the [documentation](https://logfire.pydantic.dev/docs/) has much more detail.\n\n### Install\n\n```bash\npip install logfire\n```\n[_(learn more)_](https://logfire.pydantic.dev/docs/guides/first_steps/#install)\n\n## Authenticate\n\n```bash\nlogfire auth\n```\n[_(learn more)_](https://logfire.pydantic.dev/docs/guides/first_steps/#authentication)\n\n### Manual tracing\n\nHere's a simple manual tracing (aka logging) example:\n\n```python\nimport logfire\nfrom datetime import date\n\nlogfire.info('Hello, {name}!', name='world')\n\nwith logfire.span('Asking the user their {question}', question='age'):\n    user_input = input('How old are you [YYYY-mm-dd]? ')\n    dob = date.fromisoformat(user_input)\n    logfire.debug('{dob=} {age=!r}', dob=dob, age=date.today() - dob)\n```\n[_(learn more)_](https://logfire.pydantic.dev/docs/guides/onboarding-checklist/add-manual-tracing/)\n\n### Integration\n\nOr you can also avoid manual instrumentation and instead integrate with [lots of popular packages](https://logfire.pydantic.dev/docs/integrations/), here's an example of integrating with FastAPI:\n\n```py\nimport logfire\nfrom pydantic import BaseModel\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\nlogfire.configure()\nlogfire.instrument_fastapi(app)\n# next, instrument your database connector, http library etc. and add the logging handler\n\nclass User(BaseModel):\n    name: str\n    country_code: str\n\n@app.post('/')\nasync def add_user(user: User):\n    # we would store the user here\n    return {'message': f'{user.name} added'}\n```\n[_(learn more)_](https://logfire.pydantic.dev/docs/integrations/fastapi/)\n\nLogfire gives you a view into how your code is running like this:\n\n![Logfire screenshot](https://logfire.pydantic.dev/docs/images/index/logfire-screenshot-fastapi-200.png)\n\n## Contributing\n\nWe'd love anyone interested to contribute to the Logfire SDK and documentation, see the [contributing guide](https://github.com/pydantic/logfire/blob/main/CONTRIBUTING.md).\n\n## Reporting a Security Vulnerability\n\nSee our [security policy](https://github.com/pydantic/logfire/security).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The best Python observability tool! \ud83e\udeb5\ud83d\udd25",
    "version": "2.8.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e76bf000ac13a5758c846eb50a1d4eea6fcea9f47529721739f8deea42d45896",
                "md5": "82e3928733c8a3b656e70d56dc3f54dc",
                "sha256": "1cffd2971e1bed4ccc7b3a3a4693a0c8764127d2644b2f14de291fa6dfbf55af"
            },
            "downloads": -1,
            "filename": "logfire-2.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "82e3928733c8a3b656e70d56dc3f54dc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 174908,
            "upload_time": "2024-12-18T11:33:50",
            "upload_time_iso_8601": "2024-12-18T11:33:50.712358Z",
            "url": "https://files.pythonhosted.org/packages/e7/6b/f000ac13a5758c846eb50a1d4eea6fcea9f47529721739f8deea42d45896/logfire-2.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2325d5f4bf06441540f0c8dc350271d8a76fb733a7d4cf9c79d4188469d55b82",
                "md5": "5a485cfbd2b6682c02a377d5d9e6d7f7",
                "sha256": "443da9547d88db384fb1f00d626ebecd18964a6402cf6f6af8497efa000bd0ee"
            },
            "downloads": -1,
            "filename": "logfire-2.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5a485cfbd2b6682c02a377d5d9e6d7f7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 257461,
            "upload_time": "2024-12-18T11:33:58",
            "upload_time_iso_8601": "2024-12-18T11:33:58.629879Z",
            "url": "https://files.pythonhosted.org/packages/23/25/d5f4bf06441540f0c8dc350271d8a76fb733a7d4cf9c79d4188469d55b82/logfire-2.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-18 11:33:58",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "logfire"
}
        
Elapsed time: 0.41338s