sentry-python v2.60.0 Release Notes
Release Date: 2026-05-13 // 9 days ago-
Adds a new
stream_gen_ai_spansoption that controls howgen_aispans are
sent to Sentry. When set, the SDK extracts allgen_aispans out of a
transaction and sends them as v2 envelope items.🛰 Enable this option if
gen_aispans are being dropped because the transaction payload exceeds size limits.importsentry\_sdksentry\_sdk.init(dsn='https://[email protected]/0',stream\_gen\_ai\_spans=True, )🆕 New Features ✨
- 👍 (asyncpg) Add cursor span support via BaseCursor method patching by @ericapisani in #6252
- (integrations) Pass along the conversation ID for openai
responsescalls by @constantinius in #6199 - (wsgi,asgi) Introduce substitute values for filtered fields in span-streaming mode by @ericapisani in #6178
- Remove truncation when
stream_gen_ai_spansis enabled by @alexander-alderman-webb in #6260 - ➕ Add option to send GenAI spans in the new span format by @alexander-alderman-webb in #6079
🐛 Bug Fixes 🐛
Openai
- Guard against
choices=Noneby @cla7aye15I4nd in #6216 - Stop setting transaction status when child span fails by @alexander-alderman-webb in #6192
- Only finish relevant spans in Responses patches by @alexander-alderman-webb in #6191
- Only finish relevant spans in Chat Completions patches by @alexander-alderman-webb in #6190
Other
- (stdlib) Instrument response body read for chunked HTTP responses by @sentrivana in #6202
- (typing) Add
@sentry_sdk.traces.traceoverloads to fix typing by @sentrivana in #6236 - 👉 Use proto version 2 to fix backfilled user agent and IP by @sentrivana in #6256
- 👉 Make sure
http.serverspans are segments by @sentrivana in #6230 - 🖐 Handle mypy 2.0 related failures by @alexander-alderman-webb in #6218
Internal Changes 🔧
Django
- Check transaction annotations on transaction events by @alexander-alderman-webb in #6251
- ✅ Reload middleware on test teardown by @alexander-alderman-webb in #6249
Openai
- 🔀 Separate sync and async embeddings patches by @alexander-alderman-webb in #6189
- 🔀 Separate sync and async Responses patches by @alexander-alderman-webb in #6188
- 🔀 Separate sync and async Chat Completions patches by @alexander-alderman-webb in #6187
Other
- (langchain) Inline global state by @alexander-alderman-webb in #6261
- (stdlib) Only capture relevant telemetry with
capture_items()by @alexander-alderman-webb in #6214 - (tests) Replace custom
envelopes_to_xhelpers withcapture_itemsby @sentrivana in #6233 - (traces) Cache valid span statuses in a module-level frozenset by @ericapisani in #6208
- Assert presence of profile chunks after session shutdown by @alexander-alderman-webb in #6213
- 🚀 🤖 Update test matrix with new releases (05/11) by @github-actions in #6247
- Make
set_custom_sampling_context()a classmethod by @alexander-alderman-webb in #6238 - Rename
_timestampto_end_timestampby @sentrivana in #6235 - 🚚 Move batcher fork safety test to batcher tests by @sentrivana in #6225
- Introduce inline type check for whether a span is StreamedSpan by @ericapisani in #6180
- ➕ Add
botocore-stubsby @alexander-alderman-webb in #6203 - ➕ Add option to drop scrubbed user IP addresses by @juliosuas in #6241
- ➕ Add .warden to .gitignore by @ericapisani in #6210
- ✂ removed universal bdist_wheel option by @Muskaan436 in #6197
- 🖨 (transport) Add EnvelopePrinterTransport for debug logging by @ericapisani in #6181
Previous changes from v2.59.0
-
🆕 New Features ✨
Langchain
- Record
run_nameasgen_ai.function_idon Invoke Agent Spans by @alexander-alderman-webb in #5926 - Record
run_nameinon_tool_startby @alexander-alderman-webb in #5925 - Record
run_nameinon_chat_model_startby @alexander-alderman-webb in #5924
Other
- (ci) Cancel in-progress PR workflows on new commit push by @joshuarli in #5994
- ⚡️ (consts) Add updated span convention constants to SPANDATA by @ericapisani in #6093
- 👍 (fastapi) Support span streaming in active thread tracking by @ericapisani in #6118
- (httpx) Migrate to span first by @ericapisani in #6084
- (huggingface_hub) Migrate to span first by @ericapisani in #6124
- (mcp) Migrate to span first by @ericapisani in #6131
- ➕ Add
db.driver.namespans to database integrations by @ericapisani in #6082
🐛 Bug Fixes 🐛
0️⃣ We've put additional data that might contain sensitive information, like GraphQL documents, behind the
send_default_piioption.Httpx
- Consistently early-exit when adding request source by @alexander-alderman-webb in #6151
- Set
code.namespaceandcode.functioninstead ofcode.function.namein span streaming by @alexander-alderman-webb in #6150
Langchain
- Record
run_nameasgen_ai.function_idfor text completions by @alexander-alderman-webb in #6073 - Set agent name as
gen_ai.agent.namefor chat and tool spans by @alexander-alderman-webb in #5877
Other
- (asgi) Use
inspect.iscoroutinefunctionon Python 3.14+ by @alexander-alderman-webb in #6135 - 🔒 (batcher) Reset lock and flusher in child after fork by @ericapisani in #6163
- (google_genai) Redact binary data in inline_data and fix multi-part message extraction by @ericapisani in #5977
- (grpc) Add isolation_scope to async server interceptor by @robinvd in #5940
- 🔊 (metrics,logs) Don't attach
span_idif no active span by @sentrivana in #6162 - (monitor) Release
Monitor._thread_lockafter fork (#6148) by @vokracko in #6159 - (openai-agents) Resolve agent from
bindingsfor openai-agents >= 0.14 by @ericapisani in #6102 - (profiler) Stop nulling buffer on teardown by @ericapisani in #6075
- (quart) Use
inspect.iscoroutinefunctionwhen Quart does by @alexander-alderman-webb in #6133 - ⚡️ (security) Prevent GitHub script injection in update-tox workflow by @fix-it-felix-sentry in #6171
- (starlette/fastapi) Use
inspect.iscoroutinefunctionwhen Starlette does by @alexander-alderman-webb in #6134 - (tornado) Make sure context manager doesn't double yield by @sentrivana in #6152
- Introduce
_get_current_streamed_span()to keep types backwards compatible by @alexander-alderman-webb in #6177
Internal Changes 🔧
Stdlib
- Pin timestamps in
add_http_request_source()patch by @alexander-alderman-webb in #6160 - ✅ Stop mocking
HTTPSConnection.sendin trace header tests by @alexander-alderman-webb in #6156
Other
- (batcher) Only flush the bucket that triggered the flush event by @sentrivana in #6168
- 🚚 (celery) Remove unused
NoOpMgrfrom utils by @sentrivana in #6078 - ⚡️ (ci) Update outdated pinned action version comments by @JoshuaMoelans in #6088
- ✅ (fastmcp) Span streaming tests by @alexander-alderman-webb in #6167
- ⚡️ (graphql) Update document setting by @sentrivana in #6153
- 🔀 (grpc) Mirror sync interceptor by @sentrivana in #6158
- 🚚 (langchain) Separate test to remove conditional by @alexander-alderman-webb in #6076
- 🚚 (pydantic-ai) Remove dead
Model.requestpatch by @alexander-alderman-webb in #5956 - ⚡️ (queues) Update integrations by @sentrivana in #6157
- (tests) Replace deprecated
enable_tracingwithtraces_sample_rateby @sentrivana in #6077 - 🚚 (transport) Remove redundant checks for dsn by @psh9508 in #6104
- 📇 Rename file by @sentrivana in #6194
- 🚀 🤖 Update test matrix with new releases (05/04) by @github-actions in #6186
- Assert presence of profile chunks after shutdown by @alexander-alderman-webb in #6174
- 🚀 🤖 Update test matrix with new releases (04/29) by @github-actions in #6173
- ⚡️ Limit
update-toxaction to master branch by @alexander-alderman-webb in #6172 - Expand scrubbing by @sentrivana in #6161
- Remove Python 2 compat from qualname_from_function by @ericapisani in #6137
- 🚀 Update test matrix with new releases (04/27) by @alexander-alderman-webb in #6146
- ✅ Raise shutdown timeout in aws lambda tests by @sentrivana in #6129
- ✅ Join thread in continuous profiler test by @alexander-alderman-webb in #6125
- 🚀 🤖 Update test matrix with new releases (04/20) by @github-actions in #6100
- Set explicit base-branch for codecov action by @ericapisani in #5992
- Record