Repository navigation
Releases: getsentry/sentry-python
Release list
3.0.0b2
This is a pre-release of the next Python SDK major, to be released in November 2026.
Want to give it a spin? Let us know how it went!
✨ Notable Changes
- Say goodbye to transactions: span streaming is now the default tracing model
- The fine-grained
data_collectionsupersedes the flatsend_default_pii
🗞️ Resources
2.73.0
New Features ✨
- (arq) Add an option to monitor arq cron jobs by @wedamija in #8051
- (huey) Add an option to monitor Huey periodic tasks by @wedamija in #8052
- (rq) Add an option to monitor rq-scheduler jobs by @wedamija in #8053
- (types) Export Attributes from the public types module by @sansynx in #8019
Bug Fixes 🐛
- (arq) Don't monitor cron jobs with unsupported schedules by @wedamija in #8098
- (attributes) Handle special float values correctly by @sentrivana in #8067
- (celery) Don't round down beat schedule intervals by @wedamija in #7842
- (cohere) Stop swallowing exceptions during stream iteration by @intertermux-code in #8017
- (huggingface_hub) Stop swallowing exceptions during stream iteration by @intertermux-code in #8018
- Exclude litellm==1.107.0 from extras by @jonny-norwine in #8104
Internal Changes 🔧
Deps
- Update github workflows by @renovate in #8045
- Update github workflows by @renovate in #8036
- Update github workflows by @renovate in #7276
Other
- (litellm) Require filelock>=4.0.3 on Python 3.10/3.11 by @sentry-junior in #8026
- (monitor) Stop background health checks in tests that drive the monitor by @sentry-junior in #8032
- Update
AGENTS.mdby @sentrivana in #8077 - 🤖 Update test matrix with new releases (10/12) by @github-actions in #7944
3.0.0b1
This is a pre-release of the next Python SDK major, to be released in November 2026.
Want to give it a spin? Be our guest and let us know how it went!
2.72.0
New Features ✨
Asgi
- Set
user_agent.originalfor inbound filters by @sentrivana in #7794 - Add
sentry.is_localhostfor inbound filters by @sentrivana in #7781
Boto3
- Add
ServiceExtensionclass by @pabloDeputter in #7536 - Add response, retry, and error span attributes by @pabloDeputter in #7499
- Add common OTel AWS client attributes by @pabloDeputter in #7481
Wsgi
- Add
user_agent.originalattr for inbound filters by @sentrivana in #7793 - Add
sentry.is_localhostfor inbound filters by @sentrivana in #7780
Other
- (aiohttp) Add
sentry.is_localhostfor inbound filters by @sentrivana in #7785 - (aiohttp,sanic,tornado) Add
user_agent.originalattr for inbound filters by @sentrivana in #7795 - (sanic) Add
sentry.is_localhostfor inbound filters by @sentrivana in #7783 - (tornado) Add
sentry.is_localhostfor inbound filters by @sentrivana in #7787 - (types) Export DataCollectionUserOptions from sentry_sdk.types by @sentrivana in #7957
- Better IPv6 localhost detection by @sentrivana in #7786
Bug Fixes 🐛
Boto3
- Trace the complete botocore client-call lifecycle by @pabloDeputter in #7538
- Finish
StreamingBodyspan correctly by @pabloDeputter in #7540
Other
- (crons) Return
Nonefromcapture_checkinwhen nothing is sent by @HardMax71 in #7868 - (scrubber) Scrub request bodies that are JSON arrays by @Om-singhaI in #7561
- Fix span, metrics, log client reports by @sentrivana in #7933
Internal Changes 🔧
Deps
Openai Agents
- Bump version for type checking to 0.23.1 by @alexander-alderman-webb in #7935
- Use
model_dump()instead of deprecateddict()by @intertermux-code in #7862
Starlette
- Drop direct
anyiodependency by @alexander-alderman-webb in #7724 - Expect parametrized route in
starlette>=1.7by @alexander-alderman-webb in #7789
Other
- (boto3) Split integration into internal modules by @pabloDeputter in #7537
- (huggingface_hub) Use
httpx2-pytestforhuggingface_hub>=2by @alexander-alderman-webb in #7790 - (mypy) Bump version to 2.4.0 by @alexander-alderman-webb in #7937
- (openai) Stop directly calling
_calculate_*_token_usage()by @alexander-alderman-webb in #7875 - (strawberry-graphql) Bump version for type checking to 0.332.0 by @alexander-alderman-webb in #7936
- Deprecate
ai.monitoring.record_token_usage()by @alexander-alderman-webb in #7918 - Deprecate
send_default_piiby @sentrivana in #7694 - Move FastAPI active thread tracking into Starlette by @faizansaiyed123 in #7825
- Upgrade ubuntu 20.04/22.04 runners to 24.04 by @joshuarli in #7843
- 🤖 Update test matrix with new releases (10/05) by @github-actions in #7849
- 🤖 Update test matrix with new releases (09/28) by @github-actions in #7715
- Deprecate transaction profiling by @sentrivana in #7751
2.71.0
New Features ✨
-
New integration: TypeSafe (#4733) by @alexander-alderman-webb
Add the TypeSafe integration to your
sentry_sdk.initcall:
import sentry_sdk
from sentry_sdk.integrations.typesafe import TypeSafeIntegration
sentry_sdk.init(
dsn="...",
traces_sample_rate=1.0,
integrations=[
TypeSafeIntegration(),
]
)Typesafe
- Record
gen_ai.output.messagesby @alexander-alderman-webb in #7720 - Set token usage attributes by @alexander-alderman-webb in #7719
- Record
gen_ai.input.messagesby @alexander-alderman-webb in #7718 - Record
gen_ai.response.modelby @alexander-alderman-webb in #7717 - Add integration with
system_one()patches by @alexander-alderman-webb in #7716
Bug Fixes 🐛
- Keep event if processor raises by @sentrivana in #7701
- Isolate user callbacks, emit client reports by @sentrivana in #7692
Documentation 📚
- Promote
data_collectionin changelog by @sentrivana in #7565
Internal Changes 🔧
- (aws-lambda) Add
.gitignoreto lambda handlers by @pabloDeputter in #7638 - (litellm) Set
LITELLM_LOCAL_MODEL_COST_MAP=trueby @alexander-alderman-webb in #7630 - (otlp) Adjust to
OTLPSpanExporter._headersremoval by @alexander-alderman-webb in #7722 - Use top-level flush API in tests by @sentrivana in #7725
- Unsample on sampler exception by @sentrivana in #7723
- Use
sentry_initfixture by @sentrivana in #7577
2.70.0
New Features ✨
-
New integration: Mistral AI (#4733) by @alexander-alderman-webb
Add the Mistral integration to your
sentry_sdk.initcall:
import sentry_sdk
from sentry_sdk.integrations.mistral import MistralIntegration
sentry_sdk.init(
dsn="...",
traces_sample_rate=1.0,
integrations=[
MistralIntegration(),
]
)-
New option: A fine-grained way to configure what data should be sent from the SDK.
Offers much more flexibility than
send_default_pii, allowing you to specify what
data should be collected. Ifdata_collectionis defined, it takes precedence over
send_default_pii.See https://docs.sentry.io/platforms/python/configuration/options/#data_collection
for the available configuration options.
import sentry_sdk
sentry_sdk.init(
data_collection={
"user_info": False,
"gen_ai": {"inputs": False, "outputs": False},
"graphql": {"document": False, "variables": False},
"database_query_data": False,
"queues": False,
"http_bodies": [],
"cookies": {
"mode": "denylist",
"terms": ["forwarded", "-ip", "remote-", "via", "-user"],
},
"http_headers": {
"request": {
"mode": "denylist",
"terms": ["forwarded", "-ip", "remote-", "via", "-user"],
},
},
"url_query_params": {
"mode": "denylist",
"terms": ["forwarded", "-ip", "remote-", "via", "-user"],
},
}
)Mistral
- Record
gen_ai.output.messagesby @alexander-alderman-webb in #7549 - Record
gen_ai.input.messagesby @alexander-alderman-webb in #7548 - Record
gen_ai.system_instructionsby @alexander-alderman-webb in #7547 - Record request parameters by @alexander-alderman-webb in #7531
- Record token usage by @alexander-alderman-webb in #7529
- Add integration with
Chat.completeandChat.complete_asyncpatches by @alexander-alderman-webb in #7528
Internal Changes 🔧
- (data-collection) Promote
data_collectionfrom_experimentso top-level by @ericapisani in #7560 - Close client on teardown by @alexander-alderman-webb in #7562
- 🤖 Update test matrix with new releases (09/21) by @github-actions in #7546
- Remove
getsentry/testing-ai-sdk-integrationsby @alexander-alderman-webb in #7526
2.69.2
Bug Fixes 🐛
- (aws-lambda) Attach user info when streaming spans by @sentrivana in #7429
- (bottle) Avoid infinite serializing loop by @sentrivana in #7511
- (clickhouse_driver) Only set
db.resultin breadcrumb with sensitive data opt-in by @alexander-alderman-webb in #7432 - (google-genai) Tolerate
Nonecandidates by @alexander-alderman-webb in #7519 - (pydantic-ai) Stop capturing tool execution spans when validation fails by @alexander-alderman-webb in #7448
- (serializer) Add type annotations to databag limits by @8rulerstar in #7505
- (tracing) Make
functions_to_tracework when streaming spans by @sentrivana in #7430 - (typing) Fix
disabled_integrationstype by @sentrivana in #7506 - Don't attach stacktrace to check-ins by @sentrivana in #7497
Documentation 📚
- Update span streaming docstrings by @sentrivana in #7463
Internal Changes 🔧
Huggingface Hub
- Parametrize tests on the streaming trace lifecycle by @alexander-alderman-webb in #7436
- Only check relevant data with
ApproxDictby @alexander-alderman-webb in #7434
Pydantic Ai
- Remove vacuous
_set_model_data()tests by @alexander-alderman-webb in #7453 - Remove vacuous
_set_agent_data()tests by @alexander-alderman-webb in #7450
Other
- (deps) Lock file maintenance by @renovate in #7302
- (django) Fix flaky cache tests by using uuid for cache LOCATION by @sentry-junior in #7444
- (pymongo) Raise
maxWireVersionby @alexander-alderman-webb in #7473 - Remove unused base64 utils by @sentrivana in #7495
- 🤖 Update test matrix with new releases (09/14) by @github-actions in #7486
- 🤖 Update test matrix with new releases (09/07) by @github-actions in #7399
Other
- Skip formatting log records when Sentry logs are off by @gyanu2507 in #7422
2.69.1
New Features ✨
- (django) Add
http.routeattribute by @alexander-alderman-webb in #7428
Bug Fixes 🐛
- (aiohttp) Preserve SigV4-signed propagation headers by @Robinbinu in #7427
Internal Changes 🔧
Mcp
- Parametrize tests on the streaming trace lifecycle by @alexander-alderman-webb in #7424
- Remove vacuous tests by @alexander-alderman-webb in #7420
Other
- (cohere) Parametrize tests on the streaming trace lifecycle by @alexander-alderman-webb in #7419
- (openai-agents) Parametrize tests on
stream_gen_ai_spansand the streaming trace lifecycle by @alexander-alderman-webb in #7405
2.69.0
New Features ✨
Other
- (aiohttp) Add
http.routeattribute by @alexander-alderman-webb in #7341 - (bottle) Add
http.routeattribute by @alexander-alderman-webb in #7343 - (clickhouse_driver) Set breadcrumbs in the streaming trace lifecycle by @alexander-alderman-webb in #7325
- (docs) Add Plausible analytics to Sphinx docs by @ericapisani in #7319
- (falcon) Add
http.routeattribute by @alexander-alderman-webb in #7340 - (fastapi) Add
http.routeattribute by @alexander-alderman-webb in #7322 - (flask) Add
http.routeattribute by @alexander-alderman-webb in #7344 - (pyramid) Add
http.routeattribute by @alexander-alderman-webb in #7347 - (quart) Add
http.routeattribute by @alexander-alderman-webb in #7348 - (sqlalchemy) Add more db system names for span data by @ericapisani in #7329
- (starlette) Add
http.routeattribute by @alexander-alderman-webb in #7338 - (types) Export SpanJSON type by @ericapisani in #7331
- Add Python 3.15 to test matrix by @sentrivana in #7326
Bug Fixes 🐛
Mcp
- Handle
Nonearguments in tool and prompt handlers by @alexander-alderman-webb in #7387 - Don't report stateless StreamableHTTP servers as stdio by @Snaylaker in #7224
Openai
- Read
input_textparts for the Responses API by @alexander-alderman-webb in #7333 - Check
Response.outputis alistbefore iterating by @alexander-alderman-webb in #7238
Starlette
- Use
urltransaction source for host routing by @mjq in #7266 - Set transaction name on current scope in sync handler by @mjq in #7201
Other
- (batcher) Do not let a failed flush kill the flusher thread (#7138) by @zkasuran in #7186
- (boto3) Fix botocore SigV4 failures caused by post-sign trace propagation by @pabloDeputter in #7050
- (httpx,httpx2) Always capture breadcrumb by @sentrivana in #7351
- (mcp,langchain) Add mechanism to captured exceptions by @gmassello in #7226
- (openai-agents) Use
isinstanceto determine tool type by @alexander-alderman-webb in #7412 - (quart) Skip quart-flask-patch and adjust error test for quart>=0.23 by @ericapisani in #7320
- Allow to correctly compare parsed versions by @sentrivana in #7184
Internal Changes 🔧
Openai Agents
- Capture spans instead of reading from span recorder by @alexander-alderman-webb in #7404
- Pin
openaiversion when incompatible by @alexander-alderman-webb in #7236
Pydantic Ai
- Replace individual hooks with
hooks.on.model_requestby @alexander-alderman-webb in #7327 - Fix instructions test for pydantic-ai >=2.36.0 by @ericapisani in #7321
Other
- (aiohttp) Remove dead segment name code by @mjq in #7284
- (anthropic) Include
StreamedSpanin type annotations by @alexander-alderman-webb in #7373 - (mcp) Inline
_extract_handler_data_from_args()by @alexander-alderman-webb in #7386 - (quart) Fix flake caused by flushing spans on segment end by @alexander-alderman-webb in #7240
- (stdlib) Remove urllib3 workaround by @pabloDeputter in #7283
- Add
openai-agentsto uv typing group by @alexander-alderman-webb in #7415 - Add
aiohttpto uv typing group by @alexander-alderman-webb in #7395 - Isolate
httpxtest suite fromhttpx2by @ZaafirRizwan in #7398 - Remove
test_langchain_embeddings_error_handling()by @alexander-alderman-webb in #7389 - Add
tiktokento uv typing group by @alexander-alderman-webb in #7394 - Reference renamed coverage action by @MathurAditya724 in #7371
- Remove flaky detector by @sl0thentr0py in #7363
- Add
openaito uv typing group by @alexander-alderman-webb in #7334 - 🤖 Update test matrix with new releases (08/31) by @github-actions in #7303
- Add
anthropicto uv typing group by @alexander-alderman-webb in #7324 - Add
google-genaito uv typing group by @alexander-alderman-webb in #7323 - Use tagged versions for
getsentry/codecov-actionby @alexander-alderman-webb in #7241 - Update test matrix with new releases (08/24) by @alexander-alderman-webb in #7228
- Add
httpxdependency to tests relying onget_model_response()by @alexander-alderman-webb in #7235 - Access the 'type' in an event using
.getby @ericapisani in #7239
2.68.1
enable_logs
-
(logs) Don't stop sending auto-collected logs when
enable_logs=Trueby @sentrivana in #7237If you have
enable_logsset toTrue, our logging integrations for the standard library logging module as well as Loguru will auto-collect logs and send them to Sentry as Sentry logs by default, preserving old behavior. Turning automatic collection off for a specific integration can still be achieved using thecapture_sentry_logsintegration option.import sentry_sdk from sentry_sdk.integrations.logging import LoggingIntegration from sentry_sdk.integrations.loguru import LoguruIntegration sentry_sdk.init( enable_logs=True, integrations=[ LoggingIntegration(capture_sentry_logs=True), LoguruIntegration(capture_sentry_logs=False), ], )
Please note that the
enable_logsoption is deprecated and will be removed in the next major release. Thesentry_sdk.logger.XAPI now works regardless of it, and auto-collection can be opted into via thecapture_sentry_logsintegration-level options, which areFalseby default, unless you haveenable_logs=True. We've added this compatibility layer to make the transition to aenable_logs-free world easier.
Bug Fixes 🐛
- (django) Add
failed_request_status_codesby @mgaligniana in #7140 - (anthropic) Gate
gen_ai.response.tool_callson outputs, not inputs by @ericapisani in #7207 - (google_genai) Gate streaming
gen_ai.response.tool_callson outputs, not inputs by @ericapisani in #7210 - (langchain) Use
gen_ai.tool.definitionsattribute when data collection is enabled by @ericapisani in #7204 - (langgraph,huggingface_hub) Gate
gen_ai.response.tool_callson outputs, not inputs by @ericapisani in #7208 - (openai) Gate
gen_ai.response.tool_callson outputs, not inputs by @ericapisani in #7205 - (openai_agents) Gate
gen_ai.response.tool_callson outputs, not inputs by @ericapisani in #7209