Skip to content

Releases: getsentry/sentry-python

2.11.0

24 Jul 07:56
065b23e
Compare
Choose a tag to compare

Various fixes & improvements

2.10.0

15 Jul 10:33
b026dbd
Compare
Choose a tag to compare

Various fixes & improvements

  • Add client cert and key support to HttpTransport (#3258) by @grammy-jiang

    Add cert_file and key_file to your sentry_sdk.init to use a custom client cert and key. Alternatively, the environment variables CLIENT_CERT_FILE and CLIENT_KEY_FILE can be used as well.

  • OpenAI: Lazy initialize tiktoken to avoid http at import time (#3287) by @colin-sentry

  • OpenAI, Langchain: Make tiktoken encoding name configurable + tiktoken usage opt-in (#3289) by @colin-sentry

    Fixed a bug where having certain packages installed along the Sentry SDK caused an HTTP request to be made to OpenAI infrastructure when the Sentry SDK was initialized. The request was made when the tiktoken package and at least one of the openai or langchain packages were installed.

    The request was fetching a tiktoken encoding in order to correctly measure token usage in some OpenAI and Langchain calls. This behavior is now opt-in. The choice of encoding to use was made configurable as well. To opt in, set the tiktoken_encoding_name parameter in the OpenAPI or Langchain integration.

    sentry_sdk.init(
        integrations=[
            OpenAIIntegration(tiktoken_encoding_name="cl100k_base"),
            LangchainIntegration(tiktoken_encoding_name="cl100k_base"),
        ],
    )
  • PyMongo: Send query description as valid JSON (#3291) by @0Calories

  • Remove Python 2 compatibility code (#3284) by @szokeasaurusrex

  • Fix sentry_sdk.init type hint (#3283) by @szokeasaurusrex

  • Deprecate hub in Profile (#3270) by @szokeasaurusrex

  • Stop using Hub in init (#3275) by @szokeasaurusrex

  • Delete _should_send_default_pii (#3274) by @szokeasaurusrex

  • Remove Hub usage in conftest (#3273) by @szokeasaurusrex

  • Rename debug logging filter (#3260) by @szokeasaurusrex

  • Update NoOpSpan.finish signature (#3267) by @szokeasaurusrex

  • Remove Hub in Transaction.finish (#3267) by @szokeasaurusrex

  • Remove Hub from capture_internal_exception logic (#3264) by @szokeasaurusrex

  • Improve Scope._capture_internal_exception type hint (#3264) by @szokeasaurusrex

  • Correct ExcInfo type (#3266) by @szokeasaurusrex

  • Stop using Hub in tracing_utils (#3269) by @szokeasaurusrex

2.9.0

10 Jul 08:16
af3c9c4
Compare
Choose a tag to compare

Various fixes & improvements

2.8.0

08 Jul 08:11
6f4685e
Compare
Choose a tag to compare

Various fixes & improvements

2.7.1

27 Jun 14:49
Compare
Choose a tag to compare

Various fixes & improvements

2.7.0

26 Jun 10:54
3314307
Compare
Choose a tag to compare

2.6.0

20 Jun 08:15
95d5ab7
Compare
Choose a tag to compare

2.5.1

07 Jun 19:44
411b1d4
Compare
Choose a tag to compare

This change fixes a regression in our cron monitoring feature, which caused cron checkins not to be sent. The regression appears to have been introduced in version 2.4.0.

We recommend that all users, who use Cron monitoring and are currently running sentry-python β‰₯2.4.0, upgrade to this release as soon as possible!

Other fixes & improvements

2.5.0

06 Jun 12:34
504e05e
Compare
Choose a tag to compare

Various fixes & improvements

  • Allow to configure status codes to report to Sentry in Starlette and FastAPI (#3008) by @sentrivana

    By passing a new option to the FastAPI and Starlette integrations, you're now able to configure what
    status codes should be sent as events to Sentry. Here's how it works:

    from sentry_sdk.integrations.starlette import StarletteIntegration
    from sentry_sdk.integrations.fastapi import FastApiIntegration
    
    sentry_sdk.init(
        # ...
        integrations=[
            StarletteIntegration(
                failed_request_status_codes=[403, range(500, 599)],
            ),
            FastApiIntegration(
                failed_request_status_codes=[403, range(500, 599)],
            ),
        ]
    )

    failed_request_status_codes expects a list of integers or containers (objects that allow membership checks via in)
    of integers. Examples of valid failed_request_status_codes:

    • [500] will only send events on HTTP 500.
    • [400, range(500, 599)] will send events on HTTP 400 as well as the 500-599 range.
    • [500, 503] will send events on HTTP 500 and 503.

    The default is [range(500, 599)].

    See the FastAPI and Starlette integration docs for more details.

  • Support multiple keys with cache_prefixes (#3136) by @sentrivana

  • Support integer Redis keys (#3132) by @sentrivana

  • Update SDK version in CONTRIBUTING.md (#3129) by @sentrivana

  • Bump actions/checkout from 4.1.4 to 4.1.5 (#3067) by @dependabot

2.4.0

04 Jun 07:38
505a491
Compare
Choose a tag to compare

Various fixes & improvements