Releases: getsentry/sentry-python
Releases Β· getsentry/sentry-python
2.55.0
New Features β¨
Anthropic
- Record finish reasons in AI monitoring spans by @ericapisani in #5678
- Emit
gen_ai.chatspans for asynchronousmessages.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.systemattribute 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
GeneratorExitby @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_attributeexample 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
httpxfor streamed responses by @alexander-alderman-webb in #5580 - Replace mocks with
httpxin non-MCP tool tests by @alexander-alderman-webb in #5602 - Replace mocks with
httpxin MCP tool tests by @alexander-alderman-webb in #5605 - Replace mocks with
httpxin handoff tests by @alexander-alderman-webb in #5604 - Replace mocks with
httpxin API error test by @alexander-alderman-webb in #5601 - Replace mocks with
httpxin non-error single-response tests by @alexander-alderman-webb in #5600 - Remove test for unreachable state by @alexander-alderman-webb in #5584
- Expect
namespacetool field for newopenaiversions 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
httpxto linting requirements by @alexander-alderman-webb in #5644 - Remove CodeQL action by @sentrivana in #5616
- Normalize dots in package names in
populate_tox.pyby @alexander-alderman-webb in #5574 - Do not run actions on
potel-baseby @sentrivana in #5614
2.52.0a8
This is an alpha release for internal testing.
2.54.0
New Features β¨
-
Add
set_attribute,remove_attributeto global API by @sentrivana in #5555You 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_toolby @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_normalizedfor 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_normalizedfor primitive attributes by @alexander-alderman-webb in #5504 - (github) Add warden configuration by @ericapisani in #5484
- (pydantic-ai) Remove
set_data_normalizedfor thegen_ai.response.modelattribute 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.52.0a7
This is an alpha release for internal testing.
2.52.0a6
This is an alpha release for internal testing.
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-agentscontrol-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.0a5
Documentation π
- Document
openai-agentscontrol-flow by @alexander-alderman-webb in #5447
Internal Changes π§
- (ci) Improve Craft config with title stripping and artifact filtering by @BYK in #5444
- (openai-agents) Avoid calling SDK-internal functions by @alexander-alderman-webb in #5437
- Remove references to unsupported attribute types by @alexander-alderman-webb in #5425
Other
- [do not merge] feat: Span streaming & new span API by @sentrivana in #5317
2.52.0a4
- [do not merge] feat: Span streaming & new span API by @sentrivana in #5317
2.52.0a3
New Features β¨
- feat(integration): add
gen_ai.conversation.idif available by @constantinius in #5307
Bug Fixes π
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
Span Streaming
- fix(span-streaming): Always preserialize attributes by @sentrivana in #5407
- fix(span-streaming): Warn about thread usage if any batcher is active by @sentrivana in #5408
Other
- fix(anthropic): Token reporting by @alexander-alderman-webb in #5403
- fix(celery): Close the connection we're reading driver_type from by @sentrivana in #5427
- fix(google-genai): Token reporting by @alexander-alderman-webb in #5404
- fix(openai): Token reporting by @alexander-alderman-webb in #5406
- fix(openai-agents): Inject propagation headers for
HostedMCPToolwhen 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
Messageby @alexander-alderman-webb in #5411 - test(fastmcp): Remove
test_fastmcp_without_request_context()by @alexander-alderman-webb in #5412 - test(fastmcp): Use
AsyncClientfor SSE by @alexander-alderman-webb in #5400 - test(fastmcp): Use
TestClientfor 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
AsyncClientfor SSE by @alexander-alderman-webb in #5396 - test(mcp): Use
TestClientfor Streamable HTTP by @alexander-alderman-webb in #5383 - test(mcp): Remove unused stdio helpers by @alexander-alderman-webb in #5409
Other
- ci: Pin setuptools for linting and chalice tests by @alexander-alderman-webb in #5438
- 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
Other
- [do not merge] feat: Span streaming & new span API by @sentrivana in #5317
- Update CHANGELOG.md by @alexander-alderman-webb in bcec5780
- release: 2.52.0 by @alexander-alderman-webb in 3d2154ce
- Revert "feat(ai): Add original input length meta attribute (#5375)" by @alexander-alderman-webb in #5419
2.52.0
New Features β¨
Other
- feat(integration): add
gen_ai.conversation.idif 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
HostedMCPToolwhen 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
Messageby @alexander-alderman-webb in #5411 - test(fastmcp): Remove
test_fastmcp_without_request_context()by @alexander-alderman-webb in #5412 - test(fastmcp): Use
AsyncClientfor SSE by @alexander-alderman-webb in #5400 - test(fastmcp): Use
TestClientfor 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
AsyncClientfor SSE by @alexander-alderman-webb in #5396 - test(mcp): Use
TestClientfor 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