NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #235 most downloaded on PyPI
Python client for Sentry (https://sentry.io)
Last release 5 days ago
15 Sep 2026
Ships on a steady schedule
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
8 years old
349 releases · first in 2018
This adds support to automatically integrate OpenTelemetry performance tracing with Sentry.
This adds support to automatically integrate OpenTelemetry performance tracing with Sentry.
See the documentation on how to set it up: https://docs.sentry.io/platforms/python/performance/instrumentation/opentelemetry/
Give it a try and let us know if you have any feedback or problems with using it.
By: @antonpirker (#1772, #1766, #1765)
Move set_transaction_name out of event processor in fastapi/starlette (#1751) by @sl0thentr0py
One column per quarter.
NEW: Support for MongoDB (#1590) by @Agalin
NEW: Support for MongoDB (#1590) by @Agalin
Queries to MongoDB are now instrumented!
See https://docs.sentry.io/platforms/python/guides/pymongo/ for more information.
Profiling: Do not error if already setup (#1731) by @Zylphrex
Profiling: Use sleep scheduler by default (#1729) by @Zylphrex
Profiling: Extract more frame info (#1702) by @Zylphrex
Profiling: Tune the sample profile generation code for performance (#1694) by @Zylphrex
Fix: Reading FastAPI request body twice. (#1724) by @antonpirker
Fix: Django signals problem on sentry.io (#1732) by @antonpirker
Fix: Performance optimizations for Django signals (#1725) by @antonpirker
Fix: Move relay to port 5333 to avoid collisions (#1716) by @sl0thentr0py
Fix: strip_string() checks text length counting bytes not chars (#1711) by @mgaligniana
Chore: remove jira workflow (#1707) by @vladanpaunovic
Update actions/upload-artifact to v3.1.1 (#1718) by @mattgauntseo-sentry
Update checkouts/data-schemas from a214fbc to 20ff3b9 (#1703) by @dependabot
a214fbc to 20ff3b9 (#1703) by @dependabotBug fixes for FastAPI and Sentry SDK 1.10.0 (#1699) by @antonpirker
Unified naming for span ops (#1661) by @antonpirker
Unified naming for span ops (#1661) by @antonpirker
We have unified the strings of our span operations. See https://develop.sentry.dev/sdk/performance/span-operations/
WARNING: If you have Sentry Dashboards or Sentry Discover queries that use transaction.op in their fields, conditions, aggregates or columns this change could potentially break your Dashboards/Discover setup.
Here is a list of the changes we made to the ops. Please adjust your dashboards and Discover queries accordingly:
Old operation (op) |
New Operation (op) |
|---|---|
asgi.server |
http.server |
aws.request |
http.client |
aws.request.stream |
http.client.stream |
celery.submit |
queue.submit.celery |
celery.task |
queue.task.celery |
django.middleware |
middleware.django |
django.signals |
event.django |
django.template.render |
template.render |
django.view |
view.render |
http |
http.client |
redis |
db.redis |
rq.task |
queue.task.rq |
serverless.function |
function.aws |
serverless.function |
function.gcp |
starlette.middleware |
middleware.starlette |
Include framework in SDK name (#1662) by @antonpirker
Asyncio integration (#1671) by @antonpirker
Add exception handling to Asyncio Integration (#1695) by @antonpirker
Fix asyncio task factory (#1689) by @antonpirker
Have instrumentation for ASGI middleware receive/send callbacks. (#1673) by @antonpirker
Use Django internal ASGI handling from Channels version 4.0.0. (#1688) by @antonpirker
fix(integrations): Fix http putrequest when url is None (#1693) by @MattFlower
build(deps): bump checkouts/data-schemas from f0a57f2 to a214fbc (#1627) by @dependabot
build(deps): bump flake8-bugbear from 22.9.11 to 22.9.23 (#1637) by @dependabot
build(deps): bump sphinx from 5.1.1 to 5.2.3 (#1653) by @dependabot
build(deps): bump actions/stale from 5 to 6 (#1638) by @dependabot
build(deps): bump black from 22.8.0 to 22.10.0 (#1670) by @dependabot
Remove unused node setup from ci. (#1681) by @antonpirker
Check for Decimal is in_valid_sample_rate (#1672) by @Arvind2222
Add session for aiohttp integration (#1605) by @denys-pidlisnyi
feat(profiling): Extract qualified name for each frame (#1669) by @Zylphrex
feat(profiling): Attach thread metadata to profiles (#1660) by @Zylphrex
ref(profiling): Rename profiling frame keys (#1680) by @Zylphrex
fix(profiling): get_frame_name only look at arguments (#1684) by @Zylphrex
fix(profiling): Need to sample profile correctly (#1679) by @Zylphrex
fix(profiling): Race condition spawning multiple profiling threads (#1676) by @Zylphrex
tests(profiling): Add basic profiling tests (#1677) by @Zylphrex
tests(profiling): Add tests for thread schedulers (#1683) by @Zylphrex
Use content-length header in ASGI instead of reading request body (#1646, #1631, #1595, #1573) (#1649) by @antonpirker
Instrument Django Signals so they show up in "Performance" view (#1526) by @BeryJu
Baggage creation for head of trace (#1589) by @sl0thentr0py
Note: The last version 1.9.6 introduced a breaking change where projects that used Starlette or FastAPI and had manually setup SentryAsgiMiddleware co…
Note: The last version 1.9.6 introduced a breaking change where projects that used Starlette or FastAPI
and had manually setup SentryAsgiMiddleware could not start. This versions fixes this behaviour.
With this version if you have a manual SentryAsgiMiddleware setup and are using Starlette or FastAPI
everything just works out of the box.
Sorry for any inconveniences the last version might have brought to you.
We can do better and in the future we will do our best to not break your code again.
Auto-enable Starlette and FastAPI (#1533) by @antonpirker
fix(redis): import redis pipeline using full path (#1565) by @olksdr
Remove TRANSACTION_SOURCE_UNKNOWN and default to CUSTOM (#1558) by @sl0thentr0py
Wrap StarletteRequestExtractor in capture_internal_exceptions (#1551) by @sl0thentr0py
chore: remove quotes (#1545) by @vladanpaunovic
Add deprecation warning for 3.4, 3.5 (#1541) by @sl0thentr0py
Add experimental profiler under experiments.enable_profiling (#1481) by @szokeasaurusrex
experiments.enable_profiling (#1481) by @szokeasaurusrexfeat(starlette): add Starlette integration (#1441) by @sl0thentr0py
feat(starlette): add Starlette integration (#1441) by @sl0thentr0py
Important: Remove manual usage of SentryAsgiMiddleware! This is now done by the Starlette integration.
Usage:
from starlette.applications import Starlette
from sentry_sdk.integrations.starlette import StarletteIntegration
sentry_sdk.init(
dsn="...",
integrations=[StarletteIntegration()],
)
app = Starlette(debug=True, routes=[...])
feat(fastapi): add FastAPI integration (#829) by @antonpirker
Important: Remove manual usage of SentryAsgiMiddleware! This is now done by the FastAPI integration.
Usage:
from fastapi import FastAPI
from sentry_sdk.integrations.starlette import StarletteIntegration
from sentry_sdk.integrations.fastapi import FastApiIntegration
sentry_sdk.init(
dsn="...",
integrations=[StarletteIntegration(), FastApiIntegration()],
)
app = FastAPI()
Yes, you have to add both, the StarletteIntegration AND the FastApiIntegration!
fix: avoid sending empty Baggage header (#1507) by @intgr
fix: properly freeze Baggage object (#1508) by @intgr
docs: fix simple typo, collecter -> collector (#1505) by @timgates42
feat(transactions): Transaction Source (#1490) by @antonpirker
Skip malformed baggage items (#1491) by @robyoung
feat(tracing): Dynamic Sampling Context / Baggage continuation (#1485) by @sl0thentr0py
feat(tracing): Dynamic Sampling Context / Baggage continuation (#1485) by @sl0thentr0py
The SDK now propagates the W3C Baggage Header from incoming transactions to outgoing requests.
It also extracts Sentry specific sampling information and adds it to the transaction headers to enable Dynamic Sampling in the product.
Fix Deployment (#1474) by @antonpirker
feat(measurements): Add experimental set_measurement api on transaction (#1359) by @sl0thentr0py
chore: Bump mypy and fix abstract ContextManager typing (#1421) by @sl0thentr0py
Remove Flask version contraint (#1395) by @antonpirker
fix(sqlalchemy): Use context instead of connection in sqlalchemy integration (#1388) by @sl0thentr0py
feat(asgi): Add support for setting transaction name to path in FastAPI (#1349) by @tiangolo
fix(serializer): Make sentry_repr dunder method to avoid mock problems (#1364) by @sl0thentr0py
Create feature.yml (#1350) by @vladanpaunovic
sentry_trace() template helper (#1336) by @BYKAdd session tracking to ASGI integration
sentry_repr (#1322)Work in this release contributed by @tomchuk. Thank you for your contribution!
Capture only 5xx HTTP errors in Falcon Integration
got_request_exception as well (#1317)Pick up custom urlconf set by Django middlewares from request if any
Record event_processor client reports #1281
Work in this release contributed by @johnzeringue, @pgjones and @ahopkins. Thank you for your contribution!
Fix django legacy url resolver regex substitution due to upstream CVE-2021-44420 fix #1272
sample_rate events only if tracing is enabled #1268Also record client outcomes for before send #1211
Work in this release contributed by @galuszkak, @kianmeng, @ahopkins, @razumeiko, @tomscytale, and @seedofjoy. Thank you for your contribution!
Turned client reports on by default.
Made envelope modifications in the HTTP transport non observable #1206
Fix race condition between finish and start_child in tracing #1203
finish and start_child in tracing #1203No longer set the last event id for transactions #1186
tracestate header handling #1179Fix detection of contextvars compatibility with Gevent versions >=20.9.0 #1157
Add support for Sanic versions 20 and 21 #1146
Fix for worker to set deamon attribute instead of deprecated setDaemon method #1093
AWSLambda Integration to handle other path formats for function initial handler #1139bottle Integration that discards -dev for version extraction #1085Httpx Integration #1119AWSLambda Integration #1051Fix for AWSLambda integration returns value of original handler #1106
AWSLambda integration returns value of original handler #1106RQ integration that only captures exception if RQ job has failed and ignore retries #1076Tornado integration #1060ignore_logger in the Logging Integration #1053This release contains a breaking change
This release contains a breaking change
auto_session_tracking experimental flag to a proper option and removed explicitly setting experimental session_mode in favor of auto detecting its value, hence enabling release health by default #994request.path_info rather than request.pathX-Forwarded-For header #1037Added scripts to support auto instrumentation of no code AWS lambda Python functions
Fix incorrect regex in craft to include wheel file in pypi release
Fix for error that occurs with Async Middlewares when the middleware is a function rather than a class
BREAKING CHANGE: The default environment is now production, not based on release
Fix two regressions added in 0.19.2 with regard to sampling behavior when reading the sampling decision from headers.
Fix a bug that would make applications crash if an old version of boto3 was installed.
boto3 was installed.Automatically pass integration-relevant data to traces_sampler for AWS, AIOHTTP, ASGI, Bottle, Celery, Django, Falcon, Flask, GCP, Pyramid, Tryton, RQ
traces_sampler for AWS, AIOHTTP, ASGI, Bottle, Celery, Django, Falcon, Flask, GCP, Pyramid, Tryton, RQ, and WSGI integrationsThe SDK now attempts to infer a default release from various environment variables and the current git repo.
traces_sampler option.pure_eval integration.boto3.Fix dependency check for blinker fixes #858
blinker fixes #858Removed _experiments.auto_enabling_integrations in favor of just auto_enabling_integrations which is now enabled by default.
_experiments.auto_enabling_integrations in favor of just auto_enabling_integrations which is now enabled by default.Breaking change: The no_proxy environment variable is now honored when inferring proxy settings from the system. Thanks Xavier Fernandez!
no_proxy environment variable is now honored when inferring proxy settings from the system. Thanks Xavier Fernandez!resolver_match.callback and broke user code.Fix yet another bug with disjoint traces in Celery.
Internal: Change data category for transaction envelopes.
Support for Flask 0.10 (only relaxing verson check)
Work around an issue in the Python stdlib that makes the entire process deadlock during garbage collection if events are sent from a __del__ implement
__del__ implementation.New integration for the Chalice web framework for AWS Lambda. Thanks to the folks at Cuenca MX!
Fix an issue with the pure_eval integration in interaction with trimming where pure_eval would create a lot of useless local variables that then drown
pure_eval integration in interaction with trimming where pure_eval would create a lot of useless local variables that then drown out the useful ones in trimming.Your coding agent can read these notes before it upgrades. Set up the MCP server →