github getsentry/sentry-python 2.61.0

7 hours ago

New Features ✨

  • Add 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,
    )

Bug Fixes 🐛

Langchain

Openai Agents

Pydantic AI

Strawberry

Other

  • (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 __iter__ implementations.

    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

Documentation 📚

Internal Changes 🔧

Langchain

Openai Agents

Pydantic Ai

Other

Don't miss a new sentry-python release

NewReleases is sending notifications on new releases.