Skip to content

Releases: getsentry/sentry-python

2.70.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 22 Sep 09:40

New Features ✨

import sentry_sdk
from sentry_sdk.integrations.mistral import MistralIntegration

sentry_sdk.init(
    dsn="...",
    traces_sample_rate=1.0,
    integrations=[
        MistralIntegration(),
    ]
)
import sentry_sdk

sentry_sdk.init(
    data_collection={
        "user_info": False,
        "gen_ai": {"inputs": False, "outputs": False},
        "graphql": {"document": False, "variables": False},
        "database_query_data": False,
        "queues": False,
        "http_bodies": [],
        "cookies": {
            "mode": "denylist",
            "terms": ["forwarded", "-ip", "remote-", "via", "-user"],
        },
        "http_headers": {
            "request": {
                "mode": "denylist",
                "terms": ["forwarded", "-ip", "remote-", "via", "-user"],
            },
        },
        "url_query_params": {
            "mode": "denylist",
            "terms": ["forwarded", "-ip", "remote-", "via", "-user"],
        },
    }
)

Mistral

Internal Changes πŸ”§

2.69.2

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 15 Sep 15:25

Bug Fixes πŸ›

Documentation πŸ“š

Internal Changes πŸ”§

Huggingface Hub

Pydantic Ai

Other

  • (deps) Lock file maintenance by @renovate in #7302
  • (django) Fix flaky cache tests by using uuid for cache LOCATION by @sentry-junior in #7444
  • (pymongo) Raise maxWireVersion by @alexander-alderman-webb in #7473
  • Remove unused base64 utils by @sentrivana in #7495
  • πŸ€– Update test matrix with new releases (09/14) by @github-actions in #7486
  • πŸ€– Update test matrix with new releases (09/07) by @github-actions in #7399

Other

  • Skip formatting log records when Sentry logs are off by @gyanu2507 in #7422

2.69.1

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 08 Sep 14:18

New Features ✨

Bug Fixes πŸ›

  • (aiohttp) Preserve SigV4-signed propagation headers by @Robinbinu in #7427

Internal Changes πŸ”§

Mcp

Other

2.69.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 08 Sep 08:16
f186a62

New Features ✨

Other

Bug Fixes πŸ›

Mcp

Openai

Starlette

  • Use url transaction source for host routing by @mjq in #7266
  • Set transaction name on current scope in sync handler by @mjq in #7201

Other

Internal Changes πŸ”§

Openai Agents

Pydantic Ai

Other

2.68.1

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 24 Aug 13:10
98f7d91

enable_logs

  • (logs) Don't stop sending auto-collected logs when enable_logs=True by @sentrivana in #7237

    If you have enable_logs set to True, our logging integrations for the standard library logging module as well as Loguru will auto-collect logs and send them to Sentry as Sentry logs by default, preserving old behavior. Turning automatic collection off for a specific integration can still be achieved using the capture_sentry_logs integration option.

    import sentry_sdk
    from sentry_sdk.integrations.logging import LoggingIntegration
    from sentry_sdk.integrations.loguru import LoguruIntegration
    
    sentry_sdk.init(
        enable_logs=True,
        integrations=[
            LoggingIntegration(capture_sentry_logs=True),
            LoguruIntegration(capture_sentry_logs=False),
        ],
    )

    Please note that the enable_logs option is deprecated and will be removed in the next major release. The sentry_sdk.logger.X API now works regardless of it, and auto-collection can be opted into via the capture_sentry_logs integration-level options, which are False by default, unless you have enable_logs=True. We've added this compatibility layer to make the transition to a enable_logs-free world easier.

Bug Fixes πŸ›

  • (django) Add failed_request_status_codes by @mgaligniana in #7140
  • (anthropic) Gate gen_ai.response.tool_calls on outputs, not inputs by @ericapisani in #7207
  • (google_genai) Gate streaming gen_ai.response.tool_calls on outputs, not inputs by @ericapisani in #7210
  • (langchain) Use gen_ai.tool.definitions attribute when data collection is enabled by @ericapisani in #7204
  • (langgraph,huggingface_hub) Gate gen_ai.response.tool_calls on outputs, not inputs by @ericapisani in #7208
  • (openai) Gate gen_ai.response.tool_calls on outputs, not inputs by @ericapisani in #7205
  • (openai_agents) Gate gen_ai.response.tool_calls on outputs, not inputs by @ericapisani in #7209

2.68.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 13 Aug 09:06
c819e66

Important

  • We're making enable_logs and enable_metrics no-op with this release (#7177), and they'll be dropped in the next major.

    Previously, enable_logs also controlled automatic logs collection from the logging and Loguru integrations. These integrations now get an integration-level capture_sentry_logs boolean option to allow for more control over the auto-collection. These options are False by default, i.e., nothing is auto-collected without your explicit opt-in.

    Action Needed

    If you had enable_logs set to True:

    • If you were using the sentry_sdk.logger.X API, no action necessary, the API will just work.
    • If you were auto-collecting logs from either LoggingIntegration or LoguruIntegration, the auto-collection will be turned off in this release. You can switch auto-collection on explicitly with:
    import sentry_sdk
    from sentry_sdk.integrations.logging import LoggingIntegration
    from sentry_sdk.integrations.loguru import LoguruIntegration
    
    sentry_sdk.init(
        integrations=[
            LoggingIntegration(capture_sentry_logs=True),
            LoguruIntegration(capture_sentry_logs=True),
        ],
    )

    If you had enable_logs set to False:

    • If you were using it to gate usages of the sentry_sdk.logger.X API, you'll need to remove the calls entirely or define a before_send_log callback to filter out unwanted logs.

    If you has enable_metrics set to False:

    • Any metrics emitted using the metrics API will be emitted. You'll need to drop them in a before_send_metric or remove the calls to the API.

    Why We're Doing This

    We recognize this is a disruptive change for some folks and want to make it clear this is a one-off. We're removing the options because they were an unnecessary hurdle that one had to jump through to be able to use logs and metrics, and it was confusing why the logging API would not just work on its own. On the other hand, we wanted to give you more fine-grained control over automatic collection.

New Features ✨

Other

Bug Fixes πŸ›

Internal Changes πŸ”§

HTTPX, HTTPX2

Other

2.67.1

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 10 Aug 13:06

Bug Fixes πŸ›

2.67.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 10 Aug 11:42

New Features ✨

Batcher

Integrations

Langchain

Openai

Streaming

Other

Bug Fixes πŸ›

Openai Agents

Tests

  • Adapt to new exception propagation behavior in Quart by @sentrivana in #6995
  • Remove redundant type filters after capture_items with args by @sentrivana in #6867

Other

Documentation πŸ“š

Internal Changes πŸ”§

Fastmcp

Mcp

Openai Agents

Other

Read more

2.66.1

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 22 Jul 12:27

Bug Fixes πŸ›

Tracing

  • Handle exceptions raised within traces_sampler and other callbacks by @ericapisani in #6853

Internal Changes πŸ”§

2.66.0

Choose a tag to compare

@sentry-release-bot sentry-release-bot released this 16 Jul 12:42

New Features ✨

  • (tracing) Promote trace_lifecycle and ignore_spans to top-level options by @ericapisani in #6821

Bug Fixes πŸ›

Tracing

  • Skip child span creation in streaming path when no current span (HTTP clients) by @sentrivana in #6811
  • Skip child span creation in streaming path when no current span (task queues) by @sentrivana in #6814
  • Skip child span creation in streaming path when no current span (misc) by @sentrivana in #6815
  • Skip child span creation in streaming path when no current span (databases) by @sentrivana in #6808
  • Skip child span creation in streaming path when no current span (web frameworks) by @sentrivana in #6810
  • Skip child span creation in streaming path when no current span (django) by @sentrivana in #6809

Internal Changes πŸ”§