github getsentry/sentry-python 2.16.0

20 hours ago

Integrations

  • Bottle: Add failed_request_status_codes (#3618) by @szokeasaurusrex

    You can now define a set of integers that will determine which status codes
    should be reported to Sentry.

    sentry_sdk.init(
        integrations=[
            BottleIntegration(
                failed_request_status_codes={403, *range(500, 600)},
            )
        ]
    )

    Examples of valid failed_request_status_codes:

    • {500} will only send events on HTTP 500.
    • {400, *range(500, 600)} will send events on HTTP 400 as well as the 5xx range.
    • {500, 503} will send events on HTTP 500 and 503.
    • set() (the empty set) will not send events for any HTTP status code.

    The default is {*range(500, 600)}, meaning that all 5xx status codes are reported to Sentry.

  • Bottle: Delete never-reached code (#3605) by @szokeasaurusrex

  • Redis: Remove flaky test (#3626) by @sentrivana

  • Django: Improve getting psycopg3 connection info (#3580) by @nijel

  • Django: Add SpotlightMiddleware when Spotlight is enabled (#3600) by @BYK

  • Django: Open relevant error when SpotlightMiddleware is on (#3614) by @BYK

  • Django: Support http_methods_to_capture in ASGI Django (#3607) by @sentrivana

    ASGI Django now also supports the http_methods_to_capture integration option. This is a configurable tuple of HTTP method verbs that should create a transaction in Sentry. The default is ("CONNECT", "DELETE", "GET", "PATCH", "POST", "PUT", "TRACE",). OPTIONS and HEAD are not included by default.

    Here's how to use it:

    sentry_sdk.init(
        integrations=[
            DjangoIntegration(
                http_methods_to_capture=("GET", "POST"),
            ),
        ],
    )

Miscellaneous

Don't miss a new sentry-python release

NewReleases is sending notifications on new releases.