pypi / sentry-sdk
sentry-sdk
What changed in sentry-sdk 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
1 breaking2 security3 deprecations18 new APIs and options1 performance12 behavior and defaults20 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initsentry-sdk 257 changes
Breaking changes 1
Stacktraces are no longer attached to check-ins.
Security 2
The scrubber now scrubs request bodies that are JSON arrays.
The clickhouse_driver breadcrumb only sets db.result when sensitive data is opted in.
Deprecations 3
Deprecates ai.monitoring.record_token_usage().
Deprecates the send_default_pii option.
Deprecates transaction profiling.
New APIs and options 18
Exports DataCollectionUserOptions from sentry_sdk.types for users who need to import this type.
Inbound filters receive sentry.is_localhost across ASGI, WSGI, aiohttp, Sanic, and Tornado integrations.
Adds the ServiceExtension class to the Boto3 integration.
The TypeSafe integration records gen_ai.output.messages.
Adds integration support for system_one() patches.
Adds a TypeSafe integration that can be enabled in the sentry_sdk.init integrations list.
Adds fine-grained control over what data the SDK collects; when defined, it takes precedence over send_default_pii.
Adds a Mistral integration that patches Chat.complete and Chat.complete_async and records GenAI messages, system instructions, request parameters, and token usage.
The Django integration adds the http.route attribute.
aiohttp adds the http.route attribute.
Bottle adds the http.route attribute.
Falcon adds the http.route attribute.
FastAPI adds the http.route attribute.
Flask adds the http.route attribute.
Pyramid adds the http.route attribute.
Quart adds the http.route attribute.
Starlette adds the http.route attribute.
SpanJSON is now exported for developers to import and use.
Performance 1
Log records are no longer formatted when Sentry logs are off.
Behavior and default changes 12
Adds common OpenTelemetry AWS client attributes to Boto3 instrumentation.
Adds response, retry, and error span attributes for Boto3 instrumentation.
Boto3 tracing now covers the complete botocore client-call lifecycle.
Returns None when capture_checkin sends nothing.
The TypeSafe integration records gen_ai.input.messages.
The TypeSafe integration records gen_ai.response.model.
The TypeSafe integration sets token usage attributes.
Breadcrumbs are set in the streaming trace lifecycle.
The httpx and httpx2 integrations always capture a breadcrumb.
MCP and LangChain add a mechanism to captured exceptions.
SQLAlchemy span data supports more database system names.
Starlette uses the url transaction source for host routing.
Fixes and other changes 20
Fixes span, metrics, and log client reports.
Improves localhost detection for IPv6 addresses.
Finishes the span for StreamingBody correctly.
Events are kept when a processor raises an exception.
User callbacks are isolated and client reports are emitted.
User info is now attached to streaming spans in the aws-lambda integration.
Avoids an infinite serialization loop in the bottle integration.
Fixes the type of disabled_integrations.
functions_to_trace now works when spans are streamed.
The integration now tolerates None candidates.
Pydantic AI no longer captures tool execution spans when validation fails.
The aiohttp integration preserves SigV4-signed propagation headers.
A failed flush no longer kills the flusher thread.
Fixes botocore SigV4 failures caused by post-sign trace propagation.
The OpenAI Responses API integration now reads input_text parts.
Tool and prompt handlers now handle None arguments.
Quart skips quart-flask-patch and adjusts error handling for quart>=0.23.
The OpenAI integration checks that Response.output is a list before iterating.
Stateless StreamableHTTP servers are no longer reported as stdio.
Starlette sets the transaction name on the current scope in the sync handler.