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 Check out our open positions
This is the official Python SDK for Sentry
The old raven-python
client has entered maintenance mode and was moved here.
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.
pip install --upgrade sentry-sdk
import sentry_sdk
sentry_sdk.init(
"https://12927b5f211046b575ee51fd8b1ac34f@o1.ingest.sentry.io/1",
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces_sample_rate=1.0,
)
from sentry_sdk import capture_message
capture_message("Hello World") # Will create an event in Sentry.
raise ValueError() # Will also create an event in Sentry.
- To learn more about how to use the SDK refer to our docs
- Are you coming from raven-python? Use this migration guide
- To learn about internals use the API Reference
- Django
- Flask
- Bottle
- AWS Lambda
- Google Cloud Functions
- WSGI
- ASGI
- AIOHTTP
- RQ (Redis Queue)
- Celery
- Chalice
- Falcon
- Quart
- Sanic
- Tornado
- Tryton
- Pyramid
- Logging
- Apache Airflow
- Apache Beam
- Apache Spark
Please refer to CONTRIBUTING.md.
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. There is a ton of great people in our Discord community ready to help you!
This project follows semver, with three additions:
-
Semver says that major version
0
can include breaking changes at any time. Still, it is common practice to assume that only0.x
releases (minor versions) can contain breaking changes while0.x.y
releases (patch versions) are used for backwards-compatible changes (bugfixes and features). This project also follows that practice. -
All undocumented APIs are considered internal. They are not part of this contract.
-
Certain features (e.g. integrations) may be explicitly called out as "experimental" or "unstable" in the documentation. They come with their own versioning policy described in the documentation.
We recommend to pin your version requirements against 1.x.*
or 1.x.y
.
Either one of the following is fine:
sentry-sdk>=1.0.0,<2.0.0
sentry-sdk==1.5.0
A major release N
implies the previous release N-1
will no longer receive updates. We generally do not backport bugfixes to older versions unless they are security relevant. However, feel free to ask for backports of specific commits on the bugtracker.
Licensed under the BSD license, see LICENSE