On this page
Overview
sentry-python is the official Python SDK for Sentry. It captures exceptions, messages, and performance traces and integrates with Django, Flask, FastAPI, Celery, HTTPX, OpenTelemetry, and many AI and application libraries.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Capture exceptions, messages, and traces through one SDK
sentry_sdk.init() configures the DSN and sampling behavior, enabling automatic unhandled-exception capture and explicit events such as capture_message(). Performance traces can be configured through the same SDK.
Sources: [2]
Best fit
Fits Python backends that want error monitoring and performance telemetry in Sentry
It is useful across web APIs, workers, serverless functions, and batch processes when exceptions and performance traces should be correlated with releases and environments in one monitoring platform.
Sources: [2]
Before adoption
Configure DSN, sampling, and data collection for production requirements
sentry-python 2.71.0 supports Python 3.6+ and requires a Sentry account and project. User data, HTTP bodies, trace sampling, and optional integration dependencies should be configured to match privacy, cost, and performance requirements.
Official sources
- [1]getsentry/sentry-python — GitHub repository(2026-10-06)
- [2]sentry-python 2.71.0 — README(2026-10-06)
- [3]sentry-python 2.71.0 — setup.py(2026-10-06)
- [4]sentry-python 2.71.0 release(2026-10-06)
- [5]sentry-python MIT license(2026-10-06)
Supplemental curator note
The SDK can add error monitoring to existing frameworks with little code, but production configuration should go beyond the DSN: define sampling, PII and HTTP-body collection, environment, and release tagging explicitly.
Try it in 3 steps
- 1
Install sentry-python 2.71.0
Pin the reviewed stable SDK release.
python -m pip install "sentry-sdk==2.71.0" - 2
Set the DSN for a test project
Replace the placeholder with the DSN from a Sentry project used for verification. Do not commit the real DSN.
export SENTRY_DSN='https://YOUR_PUBLIC_KEY@YOUR_HOST/YOUR_PROJECT_ID' - 3
Send one message event
Send one message to the test project and confirm the event in Sentry.
python - <<'PY' import os import sentry_sdk sentry_sdk.init(dsn=os.environ['SENTRY_DSN']) sentry_sdk.capture_message('OSS Tanbou sentry-python check') sentry_sdk.flush(timeout=5) PY
Growth
Growth trends · Last 30 days
2,214 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- crash-reporting
- hacktoberfest
- python
- sdk
- sentry
- sentry-python
- tag-production
- team-web-backend
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Keep12,376 Stars
2 shared tag(s) · 1 shared category(s) · Same language
centralize monitoring alerts and connect correlation, enrichment, and response workflows
Python - Dify157,859 Stars
2 shared tag(s)
design and publish AI workflows, retrieval, and agents on one platform
TypeScript - Langfuse35,410 Stars
1 shared tag(s) · 2 shared category(s)
connect LLM application tracing, evaluation, and prompt improvement
TypeScript - SigNoz32,291 Stars
1 shared tag(s) · 2 shared category(s)
correlate logs, metrics, and traces in one OpenTelemetry-native workspace
TypeScript - Pino18,238 Stars
1 shared tag(s) · 2 shared category(s)
add low-overhead structured JSON logging to Node.js backends
JavaScript - CocoaLumberjack13,321 Stars
1 shared tag(s) · 2 shared category(s)
route one DDLog API to console, os_log, rolling files, and custom loggers on Apple platforms
Objective-C
Report incorrect information
Tell us if any listing information is incorrect or outdated.