
Sentry Python SDK
https://github.com/getsentry/sentry-python- Category
- Developer Tools
- Rank
- No. 316Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- getsentry
- GitHub
- 2.2k stars
- Latest release
- 2.69.1
- Date
About
Official Python SDK for Sentry — automatic exception capture, performance monitoring, and tracing across Django, Flask, FastAPI, and other frameworks.
What it does
It connects a Python application to a Sentry project through a DSN, then records messages, errors, sessions, profiles, and trace context. Optional adapters instrument web stacks, task queues, databases, RPC systems, and AI libraries.
Why it's ranked here
A strong choice for Python teams already committed to Sentry. The public library surface covers manual reporting and contextual enrichment, while the packaging exposes many focused integration extras. Integration setup also checks minimum dependency versions and suppresses conflicting instrumentation to reduce duplicate telemetry.
What's good
The base install stays small, requiring only certificate and HTTP transport packages. Framework support extends well beyond web servers into Celery, Redis, gRPC, OpenTelemetry, databases, feature flags, and AI tooling. The package includes type information, strict static-analysis settings, branch coverage, and explicit data-collection controls.
Tradeoffs
It requires a Sentry account and project, so it does not provide a self-contained monitoring system. Broad instrumentation adds configuration choices around sampling, user data, request bodies, and integration conflicts. Some integrations patch third-party libraries, and optional adapters bring their own dependency and version constraints.
How to use it well
Use it in Python services whose incidents and performance data should land in Sentry. Start with the base package, configure sampling and data collection deliberately, then install only the extras matching your stack. It handles application-side telemetry collection, not the hosted dashboard, project management, or monitoring backend.
Technical notes+
setup.py packages sentry_sdk, ships the py.typed marker, requires urllib3 and certifi, and defines many optional integration extras plus an OpenTelemetry propagator entry point. sentry_sdk/__init__.py re-exports the main API for events, scopes, tracing, sessions, metrics, and profiling. sentry_sdk/integrations/__init__.py lazily imports defaults, tracks processed integrations under a lock, checks minimum versions, honors disabled integrations, and deactivates overlapping AI adapters. sentry_sdk/integrations/grpc/__init__.py patches synchronous and asynchronous channels and servers with interceptors, while sentry_sdk/integrations/celery/__init__.py propagates trace headers and captures task failures. pyproject.toml configures strict mypy checks, Ruff, pytest, and branch coverage; docs/conf.py builds API documentation with Sphinx autodoc.
Observed
- License
- MIT
- Primary language
- Python
- Install surface
- PyPI package sentry-sdk, installed with pip
- Interface
- Importable Python library SDK
- Base dependencies
- urllib3 and certifi
- Platform classification
- Operating System Independent
- Typing
- Ships a PEP 561 py.typed marker
- Documentation
- Sphinx documentation uses autodoc, type-hint rendering, and intersphinx
Read from README.md, setup.py, pyproject.toml, docs/conf.py, sentry_sdk/__init__.py, sentry_sdk/ai/__init__.py, sentry_sdk/crons/__init__.py, sentry_sdk/profiler/__init__.py, sentry_sdk/integrations/__init__.py, sentry_sdk/integrations/grpc/server.py, sentry_sdk/integrations/grpc/__init__.py, sentry_sdk/integrations/redis/__init__.py, sentry_sdk/integrations/spark/__init__.py, sentry_sdk/integrations/celery/__init__.py.
What it can do
Capture and report Python exceptions automatically
Python application with unhandled exceptions → Exception reports with stack traces, context, and error details
Monitor application performance metrics
Python application runtime data → Performance metrics, transaction timing, and bottleneck analysis
Trace distributed requests across services
HTTP requests and service calls → Distributed tracing data showing request flow and timing
Instrument Django applications for error tracking
Django web application → Automated error monitoring and performance data collection
Instrument Flask applications for monitoring
Flask web application → Exception tracking and performance monitoring integration
Instrument FastAPI applications for observability
FastAPI application → Real-time error reporting and performance insights
Add custom context and tags to error reports
Custom metadata and user context → Enriched error reports with additional debugging information
Tags
Tech Stack
Media

Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.