-
Notifications
You must be signed in to change notification settings - Fork 571
docs(sdk): Enhance README with improved clarity and developer-friendly examples #3667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fef896c
docs(sdk): Enhance README with improved clarity and developer-friendl…
UTSAVS26 0f3b498
Resolve
UTSAVS26 d538124
Merge branch 'master' into UTSAVS26-patch-1
UTSAVS26 72c0d43
Update README.md
UTSAVS26 bf25741
Update README.md
UTSAVS26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,112 +1,136 @@ | ||
| Ah, it looks like I missed the **Resources** section in the enhanced version. I'll make sure it's properly included now. Here's the corrected version with the **Resources** section added: | ||
|
|
||
| --- | ||
|
|
||
| <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/)_. | ||
| _Bad software is everywhere, and we're all tired of it. Let's be real – as devs, we've all dealt with that one bug that crashes everything at the worst possible moment. Enter **Sentry**, where the mission is simple: help developers write better software faster, so we can get back to actually enjoying building stuff!_ | ||
|
|
||
| # Official Sentry SDK for Python | ||
| If you vibe with this mission, [<kbd>**check out our open positions**</kbd>](https://sentry.io/careers/) and join the crew! | ||
UTSAVS26 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Official Sentry SDK for Python 🚀 | ||
|
|
||
| [](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml) | ||
| [](https://pypi.python.org/pypi/sentry-sdk) | ||
| [](https://discord.gg/cWnMQeA) | ||
|
|
||
| This is the official Python SDK for [Sentry](http://sentry.io/) | ||
| Welcome to the official Python SDK for **[Sentry](http://sentry.io/)**! If you care about tracking down every error and performance bottleneck in your app, you're in the right place. 💻🐍 | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ### Install | ||
| ### Installation ⚡ | ||
|
|
||
| Getting Sentry into your project is super straightforward. Just drop this in your terminal: | ||
|
|
||
| ```bash | ||
| pip install --upgrade sentry-sdk | ||
| ``` | ||
|
|
||
| ### Configuration | ||
| Boom, you're done. 🎉 | ||
|
|
||
| ### Basic Configuration 🛠️ | ||
|
|
||
| A quick config example to get Sentry rolling with the essentials: | ||
|
|
||
| ```python | ||
| import sentry_sdk | ||
|
|
||
| sentry_sdk.init( | ||
| "https://[email protected]/1", | ||
| "https://[email protected]/1", # Your DSN here | ||
|
|
||
| # Set traces_sample_rate to 1.0 to capture 100% | ||
| # of transactions for performance monitoring. | ||
| traces_sample_rate=1.0, | ||
| traces_sample_rate=1.0, # Fine-tune this based on your performance needs | ||
| ) | ||
| ``` | ||
|
|
||
| ### Usage | ||
| You’re all set! With that, Sentry starts monitoring for exceptions and performance issues in the background while you keep coding 🚀. Adjust the `traces_sample_rate` for better performance monitoring granularity. | ||
|
|
||
| ### Quick Usage Example 🧑💻 | ||
|
|
||
| Now, let's generate some events that’ll show up in Sentry. You can log simple messages or capture errors: | ||
|
|
||
| ```python | ||
| from sentry_sdk import capture_message | ||
| capture_message("Hello World") # Will create an event in Sentry. | ||
| capture_message("Hello Sentry!") # You'll see this in your Sentry dashboard! | ||
|
|
||
| raise ValueError() # Will also create an event in Sentry. | ||
| raise ValueError("Oops, something went wrong!") # This will create an error event in Sentry. | ||
| ``` | ||
|
|
||
| - To learn more about how to use the SDK [refer to our docs](https://docs.sentry.io/platforms/python/). | ||
| - Are you coming from `raven-python`? [Use this migration guide](https://docs.sentry.io/platforms/python/migration/). | ||
| - To learn about internals use the [API Reference](https://getsentry.github.io/sentry-python/). | ||
| #### Explore the Docs | ||
|
|
||
| If you’re hungry for more details on advanced usage, integrations, and customization, don’t forget to check out the full docs: | ||
|
|
||
| - [Official SDK Docs](https://docs.sentry.io/platforms/python/) | ||
| - [API Reference](https://getsentry.github.io/sentry-python/) | ||
|
|
||
| ### Migrating from `raven-python`? 🐦➡️🦸 | ||
| If you’re still using `raven-python` (RIP 🪦), we’ve made the migration to the new Sentry SDK super smooth. [Check out this guide](https://docs.sentry.io/platforms/python/migration/) to switch things over seamlessly. | ||
UTSAVS26 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Integrations 💥 | ||
|
|
||
| ## Integrations | ||
| Sentry plays nice with a lot of popular Python libraries and frameworks. Here are a few of them: | ||
|
|
||
| (If you want to create a new integration, have a look at the [Adding a new integration checklist](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md#adding-a-new-integration).) | ||
| - [Django](https://docs.sentry.io/platforms/python/integrations/django/) – Full Django support for error and performance tracking. | ||
| - [Flask](https://docs.sentry.io/platforms/python/integrations/flask/) – Flask-specific error handling. | ||
| - [FastAPI](https://docs.sentry.io/platforms/python/integrations/fastapi/) – FastAPI lovers rejoice! | ||
| - [Celery](https://docs.sentry.io/platforms/python/integrations/celery/) – Distributed task monitoring with Celery? Done. | ||
| - [AWS Lambda](https://docs.sentry.io/platforms/python/integrations/aws-lambda/) – Serverless? Yup, Sentry’s got your back. | ||
|
|
||
| Want more? [Check out the full list of integrations](https://docs.sentry.io/platforms/python/integrations/). 🚀 | ||
|
|
||
| See [the documentation](https://docs.sentry.io/platforms/python/integrations/) for an up-to-date list of libraries and frameworks we support. Here are some examples: | ||
| ### Rolling Your Own Integration? 🛠️ | ||
|
|
||
| - [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/) | ||
| - [AIOHTTP](https://docs.sentry.io/platforms/python/integrations/aiohttp/) | ||
| - [SQLAlchemy](https://docs.sentry.io/platforms/python/integrations/sqlalchemy/) | ||
| - [asyncpg](https://docs.sentry.io/platforms/python/integrations/asyncpg/) | ||
| - [Redis](https://docs.sentry.io/platforms/python/integrations/redis/) | ||
| - [Celery](https://docs.sentry.io/platforms/python/integrations/celery/) | ||
| - [Apache Airflow](https://docs.sentry.io/platforms/python/integrations/airflow/) | ||
| - [Apache Spark](https://docs.sentry.io/platforms/python/integrations/pyspark/) | ||
| - [asyncio](https://docs.sentry.io/platforms/python/integrations/asyncio/) | ||
| - [Graphene](https://docs.sentry.io/platforms/python/integrations/graphene/) | ||
| - [Logging](https://docs.sentry.io/platforms/python/integrations/logging/) | ||
| - [Loguru](https://docs.sentry.io/platforms/python/integrations/loguru/) | ||
| - [HTTPX](https://docs.sentry.io/platforms/python/integrations/httpx/) | ||
| - [AWS Lambda](https://docs.sentry.io/platforms/python/integrations/aws-lambda/) | ||
| - [Google Cloud Functions](https://docs.sentry.io/platforms/python/integrations/gcp-functions/) | ||
| If you’re feeling brave and want to create a new integration or improve an existing one, we’d love to see your contribution! Make sure to read our [contributing guide](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md) before diving in. | ||
|
|
||
| ## Migrating Between Versions? 🧳 | ||
|
|
||
| ## Migrating | ||
| ### From `1.x` to `2.x` | ||
|
|
||
| ### Migrating From `1.x` to `2.x` | ||
| If you're on the older `1.x` version of the SDK, now's the perfect time to jump to `2.x`. It comes with **major upgrades** and tons of new features. Don't worry, we've got your back with a handy [migration guide](https://docs.sentry.io/platforms/python/migration/1.x-to-2.x). | ||
|
|
||
| If you're on SDK version 1.x, we highly recommend updating to the 2.x major. To make the process easier we've prepared a [migration guide](https://docs.sentry.io/platforms/python/migration/1.x-to-2.x) with the most common changes as well as a [detailed changelog](MIGRATION_GUIDE.md). | ||
| ### From `raven-python` | ||
|
|
||
| ### Migrating From `raven-python` | ||
| Using the legacy `raven-python` client? It's now in maintenance mode, but we strongly recommend migrating to this new SDK for an improved experience. Get all the details on how to migrate with our [migration guide](https://docs.sentry.io/platforms/python/migration/raven-to-sentry-sdk/). | ||
|
|
||
| The old `raven-python` client has entered maintenance mode and was moved [here](https://github.com/getsentry/raven-python). | ||
| ## Want to Contribute? 🎉 | ||
|
|
||
| If you're using `raven-python`, we recommend you to migrate to this new SDK. You can find the benefits of migrating and how to do it in our [migration guide](https://docs.sentry.io/platforms/python/migration/raven-to-sentry-sdk/). | ||
| We’d love to have your help in making the Sentry SDK even better! Whether it's squashing bugs, adding new features, or simply improving the docs – every contribution counts. | ||
|
|
||
| ## Contributing to the SDK | ||
| For details on how to contribute, please check out [CONTRIBUTING.md](CONTRIBUTING.md). Also, check the [open issues](https://github.com/getsentry/sentry-python/issues) and dive in! | ||
|
|
||
| Please refer to [CONTRIBUTING.md](CONTRIBUTING.md). | ||
| ## Need Help? 🤔 | ||
|
|
||
| ## Getting Help/Support | ||
| Sometimes things don’t go as planned (debugging is life, after all). If you need help, jump into our awesome community: | ||
|
|
||
| If you need help setting up or configuring the Python SDK (or anything else in the Sentry universe) please head over to the [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr). There is a ton of great people in our Discord community ready to help you! | ||
| - **[Sentry Discord Community](https://discord.com/invite/Ww9hbqr)** – Tons of people ready to help! | ||
| - **[Stack Overflow](http://stackoverflow.com/questions/tagged/sentry)** – Stack Overflow’s always a great place to ask for help. | ||
| - **[Sentry Forum](https://forum.sentry.io/c/sdks)** – Share ideas, get advice, and learn from the community. | ||
|
|
||
| ## Resources | ||
| ## Resources 📚 | ||
|
|
||
| - [](https://docs.sentry.io/quickstart/) | ||
| - [](https://forum.sentry.io/c/sdks) | ||
| - [](https://discord.gg/Ww9hbqr) | ||
| - [](http://stackoverflow.com/questions/tagged/sentry) | ||
| - [](https://twitter.com/intent/follow?screen_name=getsentry) | ||
| Here are some additional resources to help you make the most of Sentry: | ||
|
|
||
| ## License | ||
| - [](https://docs.sentry.io/quickstart/) – Official documentation to get you up and running. | ||
| - [](https://forum.sentry.io/c/sdks) – Sentry forums for more in-depth discussions. | ||
| - [](http://stackoverflow.com/questions/tagged/sentry) – Ask your questions here! | ||
| - [](https://discord.gg/Ww9hbqr) – Join the community on Discord. | ||
| - [](https://twitter.com/intent/follow?screen_name=getsentry) – Follow Sentry on Twitter for updates and tips. | ||
|
|
||
| Licensed under the MIT license, see [`LICENSE`](LICENSE) | ||
| ## License 📜 | ||
|
|
||
| The SDK is open-source and available under the MIT license. Check out the [LICENSE](LICENSE) file for more info. | ||
|
|
||
| ### Thanks to all the people who contributed! | ||
| --- | ||
|
|
||
| Thanks to all the contributors who have made the Sentry Python SDK awesome! 🥳💪 | ||
|
|
||
| <a href="https://github.com/getsentry/sentry-python/graphs/contributors"> | ||
| <img src="https://contributors-img.web.app/image?repo=getsentry/sentry-python" /> | ||
| </a> | ||
|
|
||
| --- | ||
|
|
||
| That’s it! Keep writing better code and let Sentry handle the errors. Keep calm and debug on! ✌️ | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.