sentry-sdk


Namesentry-sdk JSON
Version 2.18.0 PyPI version JSON
download
home_pagehttps://github.com/getsentry/sentry-python
SummaryPython client for Sentry (https://sentry.io)
upload_time2024-11-04 13:58:17
maintainerNone
docs_urlNone
authorSentry Team and Contributors
requires_python>=3.6
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
  <img src="https://sentry-brand.storage.googleapis.com/github-banners/github-sdk-python.png" alt="Sentry for Python">
</a>


_Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us, [<kbd>**check out our open positions**</kbd>](https://sentry.io/careers/)_.

# Official Sentry SDK for Python

[![Build Status](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml/badge.svg)](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml)
[![PyPi page link -- version](https://img.shields.io/pypi/v/sentry-sdk.svg)](https://pypi.python.org/pypi/sentry-sdk)
[![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/cWnMQeA)

Welcome to the official Python SDK for **[Sentry](http://sentry.io/)**!

## Getting Started

### Installation

Getting Sentry into your project is straightforward. Just run this command in your terminal:

```bash
pip install --upgrade sentry-sdk
```

### Basic Configuration

Here’s a quick configuration example to get Sentry up and running:

```python
import sentry_sdk

sentry_sdk.init(
    "https://12927b5f211046b575ee51fd8b1ac34f@o1.ingest.sentry.io/1",  # Your DSN here

    # Set traces_sample_rate to 1.0 to capture 100%
    # of transactions for performance monitoring.
    traces_sample_rate=1.0,
)
```

With this configuration, Sentry will monitor for exceptions and performance issues.

### Quick Usage Example

To generate some events that will show up in Sentry, you can log messages or capture errors:

```python
from sentry_sdk import capture_message
capture_message("Hello Sentry!")  # You'll see this in your Sentry dashboard.

raise ValueError("Oops, something went wrong!")  # This will create an error event in Sentry.
```

#### Explore the Docs

For more details on advanced usage, integrations, and customization, check out the full documentation:

- [Official SDK Docs](https://docs.sentry.io/platforms/python/)
- [API Reference](https://getsentry.github.io/sentry-python/)

## Integrations

Sentry integrates with many popular Python libraries and frameworks, including:

- [Django](https://docs.sentry.io/platforms/python/integrations/django/)
- [Flask](https://docs.sentry.io/platforms/python/integrations/flask/)
- [FastAPI](https://docs.sentry.io/platforms/python/integrations/fastapi/)
- [Celery](https://docs.sentry.io/platforms/python/integrations/celery/)
- [AWS Lambda](https://docs.sentry.io/platforms/python/integrations/aws-lambda/)

Want more? [Check out the full list of integrations](https://docs.sentry.io/platforms/python/integrations/).

### Rolling Your Own Integration?

If you want to create a new integration or improve an existing one, we’d welcome your contributions! Please read our [contributing guide](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md) before starting.

## Migrating Between Versions?

### From `1.x` to `2.x`

If you're using the older `1.x` version of the SDK, now's the time to upgrade to `2.x`. It includes significant upgrades and new features. Check our [migration guide](https://docs.sentry.io/platforms/python/migration/1.x-to-2.x) for assistance.

### From `raven-python`

Using the legacy `raven-python` client? It's now in maintenance mode, and we recommend migrating to the new SDK for an improved experience. Get all the details in our [migration guide](https://docs.sentry.io/platforms/python/migration/raven-to-sentry-sdk/).

## Want to Contribute?

We’d love your help in improving the Sentry SDK! Whether it’s fixing bugs, adding features, or enhancing documentation, every contribution is valuable.

For details on how to contribute, please check out [CONTRIBUTING.md](CONTRIBUTING.md) and explore the [open issues](https://github.com/getsentry/sentry-python/issues).

## Need Help?

If you encounter issues or need help setting up or configuring the SDK, don’t hesitate to reach out to the [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr). There is a ton of great people there ready to help!

## Resources

Here are additional resources to help you make the most of Sentry:

- [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/quickstart/) – Official documentation to get started.
- [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr) – Join our Discord community.
- [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) – Follow us on X (Twitter) for updates.
- [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](http://stackoverflow.com/questions/tagged/sentry) – Questions and answers related to Sentry.

## License

The SDK is open-source and available under the MIT license. Check out the [LICENSE](LICENSE) file for more information.

---

Thanks to everyone who has helped improve the SDK!

<a href="https://github.com/getsentry/sentry-python/graphs/contributors">
  <img src="https://contributors-img.web.app/image?repo=getsentry/sentry-python" />
</a>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/getsentry/sentry-python",
    "name": "sentry-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sentry Team and Contributors",
    "author_email": "hello@sentry.io",
    "download_url": "https://files.pythonhosted.org/packages/24/cc/0d87cc8246f52d92228aa6718a24e1988a2893f4abe2f64ec5a8bcba4185/sentry_sdk-2.18.0.tar.gz",
    "platform": null,
    "description": "<a href=\"https://sentry.io/?utm_source=github&utm_medium=logo\" target=\"_blank\">\n  <img src=\"https://sentry-brand.storage.googleapis.com/github-banners/github-sdk-python.png\" alt=\"Sentry for Python\">\n</a>\n\n\n_Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us, [<kbd>**check out our open positions**</kbd>](https://sentry.io/careers/)_.\n\n# Official Sentry SDK for Python\n\n[![Build Status](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml/badge.svg)](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml)\n[![PyPi page link -- version](https://img.shields.io/pypi/v/sentry-sdk.svg)](https://pypi.python.org/pypi/sentry-sdk)\n[![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/cWnMQeA)\n\nWelcome to the official Python SDK for **[Sentry](http://sentry.io/)**!\n\n## Getting Started\n\n### Installation\n\nGetting Sentry into your project is straightforward. Just run this command in your terminal:\n\n```bash\npip install --upgrade sentry-sdk\n```\n\n### Basic Configuration\n\nHere\u2019s a quick configuration example to get Sentry up and running:\n\n```python\nimport sentry_sdk\n\nsentry_sdk.init(\n    \"https://12927b5f211046b575ee51fd8b1ac34f@o1.ingest.sentry.io/1\",  # Your DSN here\n\n    # Set traces_sample_rate to 1.0 to capture 100%\n    # of transactions for performance monitoring.\n    traces_sample_rate=1.0,\n)\n```\n\nWith this configuration, Sentry will monitor for exceptions and performance issues.\n\n### Quick Usage Example\n\nTo generate some events that will show up in Sentry, you can log messages or capture errors:\n\n```python\nfrom sentry_sdk import capture_message\ncapture_message(\"Hello Sentry!\")  # You'll see this in your Sentry dashboard.\n\nraise ValueError(\"Oops, something went wrong!\")  # This will create an error event in Sentry.\n```\n\n#### Explore the Docs\n\nFor more details on advanced usage, integrations, and customization, check out the full documentation:\n\n- [Official SDK Docs](https://docs.sentry.io/platforms/python/)\n- [API Reference](https://getsentry.github.io/sentry-python/)\n\n## Integrations\n\nSentry integrates with many popular Python libraries and frameworks, including:\n\n- [Django](https://docs.sentry.io/platforms/python/integrations/django/)\n- [Flask](https://docs.sentry.io/platforms/python/integrations/flask/)\n- [FastAPI](https://docs.sentry.io/platforms/python/integrations/fastapi/)\n- [Celery](https://docs.sentry.io/platforms/python/integrations/celery/)\n- [AWS Lambda](https://docs.sentry.io/platforms/python/integrations/aws-lambda/)\n\nWant more? [Check out the full list of integrations](https://docs.sentry.io/platforms/python/integrations/).\n\n### Rolling Your Own Integration?\n\nIf you want to create a new integration or improve an existing one, we\u2019d welcome your contributions! Please read our [contributing guide](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md) before starting.\n\n## Migrating Between Versions?\n\n### From `1.x` to `2.x`\n\nIf you're using the older `1.x` version of the SDK, now's the time to upgrade to `2.x`. It includes significant upgrades and new features. Check our [migration guide](https://docs.sentry.io/platforms/python/migration/1.x-to-2.x) for assistance.\n\n### From `raven-python`\n\nUsing the legacy `raven-python` client? It's now in maintenance mode, and we recommend migrating to the new SDK for an improved experience. Get all the details in our [migration guide](https://docs.sentry.io/platforms/python/migration/raven-to-sentry-sdk/).\n\n## Want to Contribute?\n\nWe\u2019d love your help in improving the Sentry SDK! Whether it\u2019s fixing bugs, adding features, or enhancing documentation, every contribution is valuable.\n\nFor details on how to contribute, please check out [CONTRIBUTING.md](CONTRIBUTING.md) and explore the [open issues](https://github.com/getsentry/sentry-python/issues).\n\n## Need Help?\n\nIf you encounter issues or need help setting up or configuring the SDK, don\u2019t hesitate to reach out to the [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr). There is a ton of great people there ready to help!\n\n## Resources\n\nHere are additional resources to help you make the most of Sentry:\n\n- [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/quickstart/) \u2013 Official documentation to get started.\n- [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr) \u2013 Join our Discord community.\n- [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry) \u2013 Follow us on X (Twitter) for updates.\n- [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](http://stackoverflow.com/questions/tagged/sentry) \u2013 Questions and answers related to Sentry.\n\n## License\n\nThe SDK is open-source and available under the MIT license. Check out the [LICENSE](LICENSE) file for more information.\n\n---\n\nThanks to everyone who has helped improve the SDK!\n\n<a href=\"https://github.com/getsentry/sentry-python/graphs/contributors\">\n  <img src=\"https://contributors-img.web.app/image?repo=getsentry/sentry-python\" />\n</a>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python client for Sentry (https://sentry.io)",
    "version": "2.18.0",
    "project_urls": {
        "Changelog": "https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md",
        "Documentation": "https://docs.sentry.io/platforms/python/",
        "Homepage": "https://github.com/getsentry/sentry-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "769b2d512efdb0de203d1f0312fae53433c3009ba70b0078421d25baaedc960a",
                "md5": "7b6b5d691267db6ba1b8b1a4a32d5f9e",
                "sha256": "ee70e27d1bbe4cd52a38e1bd28a5fadb9b17bc29d91b5f2b97ae29c0a7610442"
            },
            "downloads": -1,
            "filename": "sentry_sdk-2.18.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7b6b5d691267db6ba1b8b1a4a32d5f9e",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 317514,
            "upload_time": "2024-11-04T13:58:15",
            "upload_time_iso_8601": "2024-11-04T13:58:15.166553Z",
            "url": "https://files.pythonhosted.org/packages/76/9b/2d512efdb0de203d1f0312fae53433c3009ba70b0078421d25baaedc960a/sentry_sdk-2.18.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "24cc0d87cc8246f52d92228aa6718a24e1988a2893f4abe2f64ec5a8bcba4185",
                "md5": "d68e388f9a261c00515e0f758303240f",
                "sha256": "0dc21febd1ab35c648391c664df96f5f79fb0d92d7d4225cd9832e53a617cafd"
            },
            "downloads": -1,
            "filename": "sentry_sdk-2.18.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d68e388f9a261c00515e0f758303240f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 293615,
            "upload_time": "2024-11-04T13:58:17",
            "upload_time_iso_8601": "2024-11-04T13:58:17.093766Z",
            "url": "https://files.pythonhosted.org/packages/24/cc/0d87cc8246f52d92228aa6718a24e1988a2893f4abe2f64ec5a8bcba4185/sentry_sdk-2.18.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-04 13:58:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "getsentry",
    "github_project": "sentry-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "sentry-sdk"
}
        
Elapsed time: 0.63665s