Changelog
2.59.0
New Features ✨
Langchain
- Record
run_name as gen_ai.function_id on Invoke Agent Spans by @alexander-alderman-webb in #5926
- Record
run_name in on_tool_start by @alexander-alderman-webb in #5925
- Record
run_name in on_chat_model_start by @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.name spans to database integrations by @ericapisani in #6082
Bug Fixes 🐛
We've put additional data that might contain sensitive information, like GraphQL documents, behind the send_default_pii option.
Httpx
- Consistently early-exit when adding request source by @alexander-alderman-webb in #6151
- Set
code.namespace and code.function instead of code.function.name in span streaming by @alexander-alderman-webb in #6150
Langchain
- Record
run_name as gen_ai.function_id for text completions by @alexander-alderman-webb in #6073
- Set agent name as
gen_ai.agent.name for chat and tool spans by @alexander-alderman-webb in #5877
Other
- (asgi) Use
inspect.iscoroutinefunction on 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_id if no active span by @sentrivana in #6162
- (monitor) Release
Monitor._thread_lock after fork (#6148) by @vokracko in #6159
- (openai-agents) Resolve agent from
bindings for openai-agents >= 0.14 by @ericapisani in #6102
- (profiler) Stop nulling buffer on teardown by @ericapisani in #6075
- (quart) Use
inspect.iscoroutinefunction when 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.iscoroutinefunction when 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.send in 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
NoOpMgr from 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.request patch by @alexander-alderman-webb in #5956
- (queues) Update integrations by @sentrivana in #6157
- (tests) Replace deprecated
enable_tracingwith traces_sample_rate by @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
2.58.0
New Features ✨
- (ai) Redact base64 data URLs in image_url content blocks by @ericapisani in #5953
- (integrations) Instrument pyreqwest tracing by @servusdei2018 in #5682
- (litellm) Add async callbacks by @alexander-alderman-webb in #5969
Bug Fixes 🐛
Anthropic
- Capture exceptions for
stream() calls by @alexander-alderman-webb in #5950
- Stop setting transaction status when child span fails by @alexander-alderman-webb in #5717
- Only finish relevant spans in .create() patches by @alexander-alderman-webb in #5716
Pydantic Ai
- Adapt import for new library versions by @alexander-alderman-webb in #5984
- Use first-class hooks when available by @alexander-alderman-webb in #5947
Other
- (huggingface_hub) Stop setting transaction status when a child span fails by @Zenithatic in #5952
- (litellm) Avoid double span exits when streaming by @alexander-alderman-webb in #5933
- (wsgi) Respect HTTP_X_FORWARDED_PROTO in request.url construction by @sl0thentr0py in #5963
Internal Changes 🔧
Litellm
- Replace mocks with
httpx types in rate-limit test by @alexander-alderman-webb in #5975
- Replace mocks with
httpx types in embedding tests by @alexander-alderman-webb in #5970
- Replace mocks with
httpx types in nonstreaming completion() tests by @alexander-alderman-webb in #5937
- Remove dead attributes by @alexander-alderman-webb in #5985
Other
- (ai) Remove
gen_ai.tool.type span attribute by @ericapisani in #5964
- (anthropic) Separate sync and async .create() patches by @alexander-alderman-webb in #5715
- (openai) Split token counting by API for easier deprecation by @ericapisani in #5930
- (openai-agents) Remove error attributes by @alexander-alderman-webb in #5986
- (opentelemetry) Ignore mypy error by @alexander-alderman-webb in #5927
- 🤖 Update test matrix with new releases (04/13) by @github-actions in #5983
- Fix license metadata in setup.py by @sl0thentr0py in #5934
- Update validate-pr workflow by @stephanie-anderson in #5931
Other
- Handle
None span context in the span processor and pin tokenizers version for anthropic tests on Python 3.8 by @alexander-alderman-webb in #5967
2.57.0
New Features ✨
Langchain
- Set
gen_ai.operation.name and gen_ai.pipeline.name on LLM spans by @ericapisani in #5849
- Broaden AI provider detection beyond OpenAI and Anthropic by @ericapisani in #5707
- Update LLM span operation to
gen_ai.generate_text by @ericapisani in #5796
Other
Bug Fixes 🐛
Openai
- Only wrap types with
_iterator for streamed responses by @alexander-alderman-webb in #5917
- Always set
gen_ai.response.streaming for Responses by @alexander-alderman-webb in #5697
- Simplify Responses input handling by @alexander-alderman-webb in #5695
- Use
max_output_tokens for Responses API by @alexander-alderman-webb in #5693
- Always set
gen_ai.response.streaming for Completions by @alexander-alderman-webb in #5692
- Simplify Completions input handling by @alexander-alderman-webb in #5690
- Simplify embeddings input handling by @alexander-alderman-webb in #5688
Other
- (google-genai) Guard response extraction by @alexander-alderman-webb in #5869
- Add cycle detection to exceptions_from_error by @ericapisani in #5880
Internal Changes 🔧
Ai
- Remove unused GEN_AI_PIPELINE operation constant by @ericapisani in #5886
- Rename generate_text to text_completion by @ericapisani in #5885
Langchain
- Add text completion test by @alexander-alderman-webb in #5740
- Add tool execution test by @alexander-alderman-webb in #5739
- Add basic agent test with Responses call by @alexander-alderman-webb in #5726
- Replace mocks with
httpx types by @alexander-alderman-webb in #5724
- Consolidate span origin assertion by @alexander-alderman-webb in #5723
- Consolidate available tools assertion by @alexander-alderman-webb in #5721
Openai
- Replace mocks with httpx types for streaming Responses by @alexander-alderman-webb in #5882
- Replace mocks with httpx types for streaming Completions by @alexander-alderman-webb in #5879
- Move input handling code into API-specific functions by @alexander-alderman-webb in #5687
Other
- (asyncpg) Normalize query whitespace in integration by @ericapisani in #5855
- Exclude compromised litellm versions by @alexander-alderman-webb in #5876
2.56.0
New Features ✨
- (asgi) Add option to disable suppressing chained exceptions by @alexander-alderman-webb in #5714
- (logging) Separate ignore lists for events/breadcrumbs and sentry logs by @sl0thentr0py in #5698
Bug Fixes 🐛
Anthropic
- Set exception info on streaming span when applicable by @alexander-alderman-webb in #5683
- Patch
AsyncStream.close() and AsyncMessageStream.close() to finish spans by @alexander-alderman-webb in #5675
- Patch
Stream.close() and MessageStream.close() to finish spans by @alexander-alderman-webb in #5674
Other
- (starlette) Catch Jinja2Templates ImportError by @alexander-alderman-webb in #5741
Documentation 📚
- Add note on AI PRs to CONTRIBUTING.md by @sentrivana in #5696
Internal Changes 🔧
- Pin GitHub Actions to full-length commit SHAs by @joshuarli in #5781
- Add
-latest alias for each integration test suite by @sentrivana in #5706
- Use date-based branch names for toxgen PRs by @sentrivana in #5704
- 🤖 Update test matrix with new releases (03/19) by @github-actions in #5703
- Add client report tests for span streaming by @sentrivana in #5677
Other
- Update CHANGELOG.md by @sentrivana in #5685
2.55.0
New Features ✨
Anthropic
- Record finish reasons in AI monitoring spans by @ericapisani in #5678
- Emit
gen_ai.chat spans for asynchronous messages.stream() by @alexander-alderman-webb in #5572
- Emit AI Client Spans for synchronous
messages.stream() by @alexander-alderman-webb in #5565
- Set gen_ai.response.id span attribute by @ericapisani in #5662
- Add
gen_ai.system attribute to spans by @ericapisani in #5661
Pydantic Ai
- Support ImageUrl content type in span instrumentation by @ericapisani in #5629
- Add tool description to execute_tool spans by @ericapisani in #5596
Other
- (crons) Add owner field to MonitorConfig by @julwhitney13 in #5610
- (otlp) Add collector_url option to OTLPIntegration by @sl0thentr0py in #5603
Bug Fixes 🐛
- (ai) Truncate list-based message content in AI monitoring by @ericapisani in #5631
- (anthropic) Close span on
GeneratorExit by @alexander-alderman-webb in #5643
- (celery) Propagate user-set headers by @sentrivana in #5581
- (langchain) Wrap finish_reason in array for gen_ai span attribute by @ericapisani in #5666
- (logging) Fix deadlock in log batcher by @sentrivana in #5684
- (profiler) Prevent buffer race condition during rapid start/stop cycles by @ericapisani in #5622
- (utils) Avoid double serialization of strings in safe_serialize by @ericapisani in #5587
- Enable unused import ruff check and fix unused imports by @sentrivana in #5652
Documentation 📚
- (openai-agents) Remove inapplicable comment by @alexander-alderman-webb in #5495
- Add AGENTS.md by @sentrivana in #5579
- Add
set_attribute example to changelog by @sentrivana in #5578
Internal Changes 🔧
Anthropic
- Check system and response ID attributes on spans created by
stream() by @alexander-alderman-webb in #5665
- Skip accumulation logic for unexpected types in streamed response by @alexander-alderman-webb in #5564
- Factor out streamed result handling by @alexander-alderman-webb in #5563
- Stream valid JSON by @alexander-alderman-webb in #5641
- Stop mocking response iterator by @alexander-alderman-webb in #5573
Openai Agents
- Do not fail on new tool fields by @alexander-alderman-webb in #5625
- Stop expecting a specific function name by @alexander-alderman-webb in #5623
- Set streaming header when library uses
with_streaming_response() by @alexander-alderman-webb in #5583
- Replace mocks with
httpx for streamed responses by @alexander-alderman-webb in #5580
- Replace mocks with
httpx in non-MCP tool tests by @alexander-alderman-webb in #5602
- Replace mocks with
httpx in MCP tool tests by @alexander-alderman-webb in #5605
- Replace mocks with
httpx in handoff tests by @alexander-alderman-webb in #5604
- Replace mocks with
httpx in API error test by @alexander-alderman-webb in #5601
- Replace mocks with
httpx in non-error single-response tests by @alexander-alderman-webb in #5600
- Remove test for unreachable state by @alexander-alderman-webb in #5584
- Expect
namespace tool field for new openai versions by @alexander-alderman-webb in #5599
Other
- (graphene) Simplify span creation by @sentrivana in #5648
- (httpx) Resolve type checking failures by @alexander-alderman-webb in #5626
- (pyramid) Support alpha suffixes in version parsing by @alexander-alderman-webb in #5618
- (rust) Don't implement separate scope management by @sentrivana in #5639
- (strawberry) Simplify span creation by @sentrivana in #5647
- 🤖 Update test matrix with new releases (03/16) by @github-actions in #5671
- Remove custom warden action by @sentrivana in #5653
- Add
httpx to linting requirements by @alexander-alderman-webb in #5644
- Remove CodeQL action by @sentrivana in #5616
- Normalize dots in package names in
populate_tox.py by @alexander-alderman-webb in #5574
- Do not run actions on
potel-base by @sentrivana in #5614
2.54.0
New Features ✨
-
Add set_attribute, remove_attribute to global API by @sentrivana in #5555
You can now set and unset attributes on logs and metrics via top-level API. Think of it as sentry_sdk.set_tag() for attribute-based telemetry. Other event types (transactions, spans, errors) will be unaffected.
import sentry_sdk
sentry_sdk.init(...)
sentry_sdk.set_attribute("my.attribute", "my value")
# This metric will have "my.attribute" set
sentry_sdk.metrics.count("counter", 1)
# Remove the attribute
sentry_sdk.remove_attribute("my.attribute")
# This log will not have "my.attribute" set
sentry_sdk.logger.info("An info log")
Bug Fixes 🐛
Openai
- Attach response model with streamed Completions API by @alexander-alderman-webb in #5557
- Attach response model with streamed Responses API by @alexander-alderman-webb in #5554
- Avoid consuming iterables passed to the Completions API by @alexander-alderman-webb in #5489
- Avoid consuming iterables passed to the Embeddings API by @alexander-alderman-webb in #5491
Other
- (anthropic) Fix token accounting by @shellmayr in #5490
- (google-genai) Remove agent spans for simple requests by @alexander-alderman-webb in #5443
- (grpc) Read method from handler_call_details for grpcio >= 1.76 compat by @yeung108 in #5521
- (httpx) Correctly append baggage in async client by @sentrivana in #5530
- (pydantic-ai) Adapt to missing
ToolManager._call_tool by @sentrivana in #5522
- (utils) Use HEROKU_BUILD_COMMIT env var for default release by @ericapisani in #5499
- (wsgi) Do not wrap file responses when uWSGI offload-threads is enabled by @ericapisani in #5556
Documentation 📚
- Add troubleshooting note for editable installs with uWSGI by @ericapisani in #5552
- Add debugging advice by @alexander-alderman-webb in #5517
- New integration guide by @alexander-alderman-webb in #5476
Internal Changes 🔧
Agents
- Add security-review skill to agent configuration by @ericapisani in #5498
- Add sentry skills to be used by warden in CI reviews by @ericapisani in #5485
Openai
- Only handle streamed results when applicable by @alexander-alderman-webb in #5553
- Extract input in API-specific functions by @alexander-alderman-webb in #5546
- Separate output handling by @alexander-alderman-webb in #5543
Openai Agents
- Remove
set_data_normalized for primitive attributes by @alexander-alderman-webb in #5509
- Expect new tool fields by @alexander-alderman-webb in #5471
Other
- (ai) Add configuration for dotagents by @ericapisani in #5480
- (anthropic) Remove
set_data_normalized for primitive attributes by @alexander-alderman-webb in #5504
- (github) Add warden configuration by @ericapisani in #5484
- (pydantic-ai) Remove
set_data_normalized for the gen_ai.response.model attribute by @alexander-alderman-webb in #5512
- (repo) Add .serena to .gitignore by @ericapisani in #5464
- Updated codecov.yml by @MathurAditya724 in #5571
- 🤖 Update test matrix with new releases (02/24) by @github-actions in #5524
- 🤖 Update test matrix with new releases (02/23) by @github-actions in #5503
- 🤖 Update test matrix with new releases (02/19) by @github-actions in #5483
- 🤖 Update test matrix with new releases (02/18) by @github-actions in #5475
2.53.0
Bug Fixes 🐛
Openai Agents
- Patch
execute_final_output() functions following library refactor by @alexander-alderman-webb in #5453
- Patch
execute_handoffs() functions following library refactor by @alexander-alderman-webb in #5452
- Patch
run_single_turn_streamed() functions following library refactor by @alexander-alderman-webb in #5451
- Patch
run_single_turn() functions following library refactor by @alexander-alderman-webb in #5450
- Patch models functions following library refactor by @alexander-alderman-webb in #5449
- Patch tool functions following library refactor by @alexander-alderman-webb in #5445
Other
- Close the connection we're reading driver_type from by @sentrivana in #5427
Documentation 📚
- Document
openai-agents control-flow by @alexander-alderman-webb in #5447
Internal Changes 🔧
Openai Agents
- New tool field and library error log by @alexander-alderman-webb in #5454
- Avoid calling SDK-internal functions by @alexander-alderman-webb in #5437
Other
- Improve Craft config with title stripping and artifact filtering by @BYK in #5444
- Use fixed clickhouse action, remove aws-sam-cli dependency by @sentrivana in #5457
- Remove references to unsupported attribute types by @alexander-alderman-webb in #5425
- Pin setuptools for linting and chalice tests by @alexander-alderman-webb in #5438
2.52.0
New Features ✨
Other
- feat(integration): add
gen_ai.conversation.id if available by @constantinius in #5307
Bug Fixes 🐛
Google Genai
- fix(google-genai): Token reporting by @alexander-alderman-webb in #5404
- fix(google-genai): deactivate google genai when langchain is used by @shellmayr in #5389
Mcp
- fix(mcp): Nest MCP spans under HTTP transactions by @alexander-alderman-webb in #5292
- fix(mcp): Handle all awaitable return types by @alexander-alderman-webb in #5415
Other
- fix(anthropic): Token reporting by @alexander-alderman-webb in #5403
- fix(arq): handle settings_cls passed as keyword argument by @nc9 in #5393
- fix(dramatiq): cleanup isolated scope and transaction when message is skipped by @frankie567 in #5346
- fix(openai): Token reporting by @alexander-alderman-webb in #5406
- fix(openai-agents): Inject propagation headers for
HostedMCPTool when streaming by @alexander-alderman-webb in #5405
- fix: Fix list attribute type by @sentrivana in #5417
- fix: Adapt to new packaging in toxgen by @sentrivana in #5382
Internal Changes 🔧
Fastmcp
- test(fastmcp): Wrap prompt in
Message by @alexander-alderman-webb in #5411
- test(fastmcp): Remove
test_fastmcp_without_request_context() by @alexander-alderman-webb in #5412
- test(fastmcp): Use
AsyncClient for SSE by @alexander-alderman-webb in #5400
- test(fastmcp): Use
TestClient for Streamable HTTP by @alexander-alderman-webb in #5384
- test(fastmcp): Simulate stdio transport with memory streams by @alexander-alderman-webb in #5333
Mcp
- test(mcp): Use
AsyncClient for SSE by @alexander-alderman-webb in #5396
- test(mcp): Use
TestClient for Streamable HTTP by @alexander-alderman-webb in #5383
- test(mcp): Remove unused stdio helpers by @alexander-alderman-webb in #5409
- test(mcp): Simulate stdio transport with memory streams by @alexander-alderman-webb in #5329
Other
- ci: Fix lint step by @sentrivana in #5418
- ci: 🤖 Update test matrix with new releases (02/02) by @github-actions in #5413
- ci: Update tox and pin packaging version for tox by @alexander-alderman-webb in #5381
- ci: migration to the new codecov action by @MathurAditya724 in #5392
Other
- Revert "feat(ai): Add original input length meta attribute (#5375)" by @alexander-alderman-webb in #5419
2.51.0
New Features ✨
Openai
- feat(openai): Set system instruction attribute for Responses API by @alexander-alderman-webb in #5376
- feat(openai): Set system instruction attribute for Completions API by @alexander-alderman-webb in #5358
- feat(integrations): OpenAI/OpenAI Agents detect and report the time to first token metric (TTFT) as
gen_ai.response.time_to_first_token by @constantinius in #5348
Openai Agents
- feat(openai-agents): Set system instruction attribute on
gen_ai.chat spans by @alexander-alderman-webb in #5370
- feat(openai-agents): Set system instruction attribute by @alexander-alderman-webb in #5355
- feat(integrations): openai-agents streaming support by @constantinius in #5291
Other
- feat(ai): Add original input length meta attribute by @alexander-alderman-webb in #5375
- feat(anthropic): Set system instruction attribute by @alexander-alderman-webb in #5353
- feat(asyncio): Allow to turn task spans off by @sentrivana in #5367
- feat(gen_ai): add function
set_conversation_id and managing functions on the Scope and apply it on the Span on .finish() by @constantinius in #5362
- feat(google-genai): Set system instruction attribute by @alexander-alderman-webb in #5354
- feat(langchain): Set system instruction attribute by @alexander-alderman-webb in #5357
- feat(pydantic-ai): Set system instruction attribute by @alexander-alderman-webb in #5356
- feat(transport): Report 413 responses for oversized envelopes by @alexander-alderman-webb in #5380
Bug Fixes 🐛
- fix(ai): Keep single content input message by @alexander-alderman-webb in #5345
Internal Changes 🔧
- ci(release): Fix changelog-preview permissions by @BYK in #5368
- ref: Replace
set_data_normalized() with Span.set_data() for system instructions by @alexander-alderman-webb in #5374
- ci: Fix path in AI integration tests by @alexander-alderman-webb in #5347
2.50.0
New Features ✨
Ai
- feat(ai): add cache writes for gen_ai by @shellmayr in #5319
- feat(ai): add parse_data_uri function to parse a data URI by @constantinius in #5311
Other
-
feat(asyncio): Add on-demand way to enable AsyncioIntegration by @sentrivana in #5288
You can now enable the AsyncioIntegration on demand, after calling sentry_sdk.init(). This is useful in scenarios where you don't have
the event loop running early on, or when you need to instrument multiple event loops.
import sentry_sdk
from sentry_sdk.integrations.asyncio import enable_asyncio_integration
# Initializing the SDK as early as possible, when there is no event loop yet
sentry_sdk.init(
...
# No AsyncioIntegration in explicitly provided `integrations`
)
async def main():
enable_asyncio_integration() # instruments the current event loop
# ...your code...
- feat(openai-agents): Inject propagation headers for
HostedMCPTool by @alexander-alderman-webb in #5297
- feat(stdlib): Handle proxy tunnels in httlib integration by @sl0thentr0py in #5303
- feat: Support array types for logs and metrics attributes by @alexander-alderman-webb in #5314