user.ip_address on telemetry if present by @sentrivana in #6555Add integration for aiomysql by @tonal in #4703
We're adding support for the aiomysql package. To enable the integration, add it to your integrations list:
import sentry_sdk
from sentry_sdk.integrations.aiomysql import AioMySQLIntegration
sentry_sdk.init(
traces_sample_rate=1.0,
integrations=[AioMySQLIntegration()],
)
Support HTTPX2 by @sentrivana in #6463
We're adding out-of-the-box support for HTTPX2. As long as use the package, the Sentry integration will be enabled automatically and you should see your requests instrumented in Sentry.
import httpx2
import sentry_sdk
sentry_sdk.init(...)
with sentry_sdk.start_transaction(name="testing_sentry"):
httpx2.get("https://sentry.io/")
ModelRequestContext.model exists by @alexander-alderman-webb in #6480functools.wraps() for patched functions by @alexander-alderman-webb in #6532fakeredis<2.36.0 in tests by @alexander-alderman-webb in #6444package-ecosystem: uv in dependabot by @sentrivana in #6522aiomysql version and update text matrix by @alexander-alderman-webb in #6496update-tox timeout to 20 minutes by @alexander-alderman-webb in #6488grpcio-tools source builds when generating test matrices by in fakeredis<2.36.0 in tests by @alexander-alderman-webb in #6454redis and fakeredis for tests by @alexander-alderman-webb in #6443Add server.address to transformed spans when stream_gen_ai_spans=True by @alexander-alderman-webb in #6307
Allow integrations to define control flow exceptions by @sentrivana in #6425
Disable string truncation for events by default by @alexander-alderman-webb in #6290
Following a previous significant increase of the string truncation limit, we've now completely removed the limit by default. In case you have large strings in your events, you should now be able to see them.
In rare cases, if you have really long strings (or a lot of them), you might see envelopes being dropped because of their size.
If that happens, you can set the max_value_length init option to the previous value of 100_000:
sentry_sdk.init(
...,
max_value_length=100_000,
)
TypeError on langchain.agents import by @alexander-alderman-webb in #6268starting_agent keyword argument in runner patches by @ericapisani in #6428name, not description in start_span by @sentrivana in #6323Agent.run_stream_events() patch by @alexander-alderman-webb in #6281AttributeError on graphql_span in resolve by @sentrivana in #6289(anthropic) Do not set gen_ai.response.model to None by @alexander-alderman-webb in #6312
(asyncpg) Use Sentry span attribute name conventions by @ericapisani in #6306
(boto3) Guard setting method by @sentrivana in #6288
(cohere) Stop setting transaction status when child span fails by @alexander-alderman-webb in #6300
(google-genai) Guard against None response ID and response model by @alexander-alderman-webb in #6314
(huey) Fix group and chord handling in enqueue by @ericapisani in #6392
(integrations) Auto-wrap root gen_ai spans for openai, cohere, langgraph, huggingface_hub by @constantinius in #6285
(serializer) Don't call __iter__ on arbitrary sequences by @sentrivana in #6304
Previously, we'd attempt to serialize any Sequence by walking through it by calling its __iter__ function.
We've now changed the serializer to only serialize built-in sequences (like lists, tuples, and sets) to avoid
triggering side-effects from custom implementations.
beat.py docstring by @quyentonndbs in #6266node.callspec.id matching by @alexander-alderman-webb in #6426WatchedSpan class by @alexander-alderman-webb in #6407node.callspec.id matching by @alexander-alderman-webb in #6424Agent.run_stream_events() returning a context manager by @alexander-alderman-webb in #6322node.callspec.id matching by @alexander-alderman-webb in #6427fake_record_sql_queries by @alexander-alderman-webb in #6295Adds a new stream_gen_ai_spans option that controls how gen_ai spans are
sent to Sentry. When set, the SDK extracts all gen_ai spans out of a
transaction and sends them as v2 envelope items.
Enable this option if gen_ai spans are being dropped because the transaction payload exceeds size limits.
import sentry_sdk
sentry_sdk.init(
dsn='https://examplePublicKey@o0.ingest.sentry.io/0',
stream_gen_ai_spans=True,
)
responses calls by @constantinius in #6199stream_gen_ai_spans is enabled by @alexander-alderman-webb in #6260choices=None by @cla7aye15I4nd in #6216@sentry_sdk.traces.trace overloads to fix typing by @sentrivana in #6236http.server spans are segments by @sentrivana in #6230capture_items() by @alexander-alderman-webb in #6214envelopes_to_x helpers with capture_items by @sentrivana in #6233set_custom_sampling_context() a classmethod by @alexander-alderman-webb in #6238_timestamp to _end_timestamp by @sentrivana in #6235run_name as gen_ai.function_id on Invoke Agent Spans by @alexander-alderman-webb in #5926run_name in on_tool_start by @alexander-alderman-webb in #5925run_name in on_chat_model_start by @alexander-alderman-webb in #5924db.driver.name spans to database integrations by @ericapisani in #6082We've put additional data that might contain sensitive information, like GraphQL documents, behind the send_default_pii option.
code.namespace and code.function instead of code.function.name in span streaming by @alexander-alderman-webb in #6150run_name as gen_ai.function_id for text completions by @alexander-alderman-webb in #6073gen_ai.agent.name for chat and tool spans by @alexander-alderman-webb in #5877inspect.iscoroutinefunction on Python 3.14+ by @alexander-alderman-webb in #6135span_id if no active span by @sentrivana in #6162Monitor._thread_lock after fork (#6148) by @vokracko in #6159bindings for openai-agents >= 0.14 by @ericapisani in #6102inspect.iscoroutinefunction when Quart does by @alexander-alderman-webb in #6133add_http_request_source() patch by @alexander-alderman-webb in #6160HTTPSConnection.send in trace header tests by @alexander-alderman-webb in #6156NoOpMgr from utils by @sentrivana in #6078Model.request patch by @alexander-alderman-webb in #5956enable_tracingwith traces_sample_rate by @sentrivana in #6077stream() calls by @alexander-alderman-webb in #5950httpx types in rate-limit test by @alexander-alderman-webb in #5975httpx types in embedding tests by @alexander-alderman-webb in #5970httpx types in nonstreaming completion() tests by @alexander-alderman-webb in #5937gen_ai.tool.type span attribute by @ericapisani in #5964None span context in the span processor and pin tokenizers version for anthropic tests on Python 3.8 by @alexander-alderman-webb in #5967gen_ai.operation.name and gen_ai.pipeline.name on LLM spans by @ericapisani in #5849gen_ai.generate_text by @ericapisani in #5796Add experimental async transport by @BYK in #5646
See https://github.com/getsentry/sentry-python/discussions/5919 for details.
_iterator for streamed responses by @alexander-alderman-webb in #5917gen_ai.response.streaming for Responses by @alexander-alderman-webb in #5697max_output_tokens for Responses API by @alexander-alderman-webb in #5693gen_ai.response.streaming for Completions by @alexander-alderman-webb in #5692httpx types by @alexander-alderman-webb in #5724AsyncStream.close() and AsyncMessageStream.close() to finish spans by @alexander-alderman-webb in #5675Stream.close() and MessageStream.close() to finish spans by @alexander-alderman-webb in #5674-latest alias for each integration test suite by @sentrivana in #5706gen_ai.chat spans for asynchronous messages.stream() by @alexander-alderman-webb in #5572messages.stream() by @alexander-alderman-webb in #5565gen_ai.system attribute to spans by @ericapisani in #5661GeneratorExit by @alexander-alderman-webb in #5643set_attribute example to changelog by @sentrivana in #5578update-tox job by @alexander-alderman-webb in #6453setuptools in relevant tests by @alexander-alderman-webb in #6467__iter__This might mean some objects might be serialized differently. If you want to continue serializing a specific
custom sequence class the old way, you can register it via sentry_sdk.serializer.add_repr_sequence_type (see
here).
Memory leak in SentrySpanProcessor by @volodkindv in #6271
botocore-stubs by @alexander-alderman-webb in #6203inspect.iscoroutinefunction when Starlette does by @alexander-alderman-webb in #6134_get_current_streamed_span() to keep types backwards compatible by @alexander-alderman-webb in #6177update-tox action to master branch by @alexander-alderman-webb in #6172