Deprecates send_default_pii and transaction profiling, and adds sentry.is_localhost plus user_agent.original attributes for inbound filters across ASGI, WSGI, aiohttp, Sanic, and Tornado. Also fixes request-body scrubbing for JSON arrays and Boto3 StreamingBody span handling.
Sentry Python
npx @buildinternet/releases get sentry-pythonNew TypeSafe integration records gen_ai input and output messages, response model, and token usage attributes. Fixed events being dropped when a processor raises and isolated user callbacks to emit client reports.
New MistralIntegration records chat request parameters, token usage, system instructions, and gen_ai input and output messages for Chat.complete and Chat.complete_async. A new data_collection option offers finer control over collected data than send_default_pii and takes precedence when defined, promoted from _experiments to top-level.
Fixed an infinite serializing loop in the Bottle integration and made functions_to_trace work when streaming spans. Also stops capturing pydantic-ai tool execution spans when validation fails and no longer attaches stacktraces to check-ins.
Django integrations now report an http.route attribute, and aiohttp no longer drops SigV4-signed propagation headers.
Adds http.route attributes to Bottle and Falcon integrations, plus breadcrumbs in the ClickHouse Driver streaming trace lifecycle. Includes documentation analytics and internal refactors.
Auto-collected logs continue to send when enable_logs=True, preserving prior behavior, and can now be controlled per integration via capture_sentry_logs. The enable_logs option is deprecated and will be removed in the next major release, as the sentry_sdk.logger.X API now works independently of it. Also fixed gen_ai tool-call gating across Anthropic, OpenAI, LangChain, and other integrations to key on outputs, not inputs.
enable_logs and enable_metrics are now no-ops and will be dropped in the next major. Logging and Loguru integrations no longer auto-collect logs unless you opt in via integration-level capture_sentry_logs=True; metrics emitted via the API are no longer gated by enable_metrics. Also added NoOpStreamedSpan segment improvements and a batcher flush trigger based on span number.
The batcher now includes a global flush trigger based on the span number, preventing unbounded accumulation of spans in memory.
Added reasoning and cached token usage tracking for Langchain, tool definitions for OpenAI Chat Completions and Responses APIs, and gen_ai.request.reasoning.level for OpenAI spans. Promoted before_send_span to a top-level option and added support for the ai_track decorator in streaming. Fixed OpenAI Agents tool wrapping, Langchain multi-candidate usage double-counting, Pydantic AI duplicate spans, and made sentry-trace take precedence over baggage in sampling.
Exceptions raised within traces_sampler and other callbacks are now properly handled instead of propagating up to crash the application.
Promoted trace_lifecycle and ignore_spans to top-level tracing options. Fixed child span creation in streaming paths for HTTP clients, task queues, databases, web frameworks, and Django when no current span exists.
Consumer spans for Huey, arq, dramatiq, and RQ now include the messaging.destination.name attribute. Also fixed a tracing bug where multiple sentry-trace headers were not choosing the first one, and a Django async middleware ValueError.
The SDK now extracts gen_ai spans out of transactions and sends them as v2 envelope items by default, preventing data loss when payloads exceed size limits. Self-hosted Sentry instances should opt out with stream_gen_ai_spans=False. Plus 19 bug fixes including PII gating for URLs across aiohttp, boto3, httpx, sanic, tornado, wsgi, and others, MCP SDK v2 handler support, and asyncpg N+1 false positive prevention.
Query string and client IP are now only captured when send_default_pii is enabled. Also fixed double wrapping of sync handlers on FastAPI >= 0.137, improved prefixed router path handling, removed reference cycles in the serializer, and removed 0000 trace_id fallbacks.
Added integration for aiomysql with manual setup via AioMySQLIntegration, and automatic out-of-the-box support for HTTPX2. Fixed control flow exception capture in arq, baggage header parsing with '=' characters, and functools.wraps restoration in rq patched functions.
String truncation is now disabled by default, allowing large strings in events to display in full; you can restore the previous limit of 100,000 characters via the max_value_length option. Fixed a serializer bug that was triggering side-effects from custom iter implementations on arbitrary sequences, and a memory leak in SentrySpanProcessor. Also includes fixes across Langchain, OpenAI Agents, Pydantic AI, Strawberry, and other integrations.
A new stream_gen_ai_spans option extracts GenAI spans from transactions and sends them as separate v2 envelope items, preventing them from being dropped when transaction payloads exceed size limits. Also adds asyncpg cursor span support, OpenAI conversation ID tracking, and fixes for OpenAI span handling and chunked HTTP response instrumentation.

