feat(deps): update dependency sentry-sdk to v2.16.0
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| sentry-sdk (changelog) | 2.10.0 -> 2.16.0 |
Release Notes
getsentry/sentry-python (sentry-sdk)
v2.16.0
Integrations
-
Bottle: Add
failed_request_status_codes(#​3618) by @​szokeasaurusrexYou 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
psycopg3connection info (#​3580) by @​nijel -
Django: Add
SpotlightMiddlewarewhen Spotlight is enabled (#​3600) by @​BYK -
Django: Open relevant error when
SpotlightMiddlewareis on (#​3614) by @​BYK -
Django: Support
http_methods_to_capturein ASGI Django (#​3607) by @​sentrivanaASGI Django now also supports the
http_methods_to_captureintegration 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",).OPTIONSandHEADare not included by default.Here's how to use it:
sentry_sdk.init( integrations=[ DjangoIntegration( http_methods_to_capture=("GET", "POST"), ), ], )
Miscellaneous
- Add 3.13 to setup.py (#​3574) by @​sentrivana
- Add 3.13 to basepython (#​3589) by @​sentrivana
- Fix type of
sample_ratein DSC (and add explanatory tests) (#​3603) by @​antonpirker - Add
httpcorebasedHTTP2Transport(#​3588) by @​BYK - Add opportunistic Brotli compression (#​3612) by @​BYK
- Add
__notes__support (#​3620) by @​szokeasaurusrex - Remove useless makefile targets (#​3604) by @​antonpirker
- Simplify tox version spec (#​3609) by @​sentrivana
- Consolidate contributing docs (#​3606) by @​antonpirker
- Bump
codecov/codecov-actionfrom4.5.0to4.6.0(#​3617) by @​dependabot
v2.15.0
Integrations
-
Configure HTTP methods to capture in ASGI/WSGI middleware and frameworks (#​3531) by @​antonpirker
We've added a new option to the Django, Flask, Starlette and FastAPI integrations called
http_methods_to_capture. 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",).OPTIONSandHEADare not included by default.Here's how to use it (substitute Flask for your framework integration):
sentry_sdk.init( integrations=[ FlaskIntegration( http_methods_to_capture=("GET", "POST"), ), ], ) -
Django: Allow ASGI to use
drf_requestinDjangoRequestExtractor(#​3572) by @​PakawiNz -
Django: Don't let
RawPostDataExceptionbubble up (#​3553) by @​sentrivana -
Django: Add
sync_capabletoSentryWrappingMiddleware(#​3510) by @​szokeasaurusrex -
AIOHTTP: Add
failed_request_status_codes(#​3551) by @​szokeasaurusrexYou can now define a set of integers that will determine which status codes should be reported to Sentry.
sentry_sdk.init( integrations=[ AioHttpIntegration( 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. -
-
AIOHTTP: Delete test which depends on AIOHTTP behavior (#​3568) by @​szokeasaurusrex
-
AIOHTTP: Handle invalid responses (#​3554) by @​szokeasaurusrex
-
FastAPI/Starlette: Support new
failed_request_status_codes(#​3563) by @​szokeasaurusrexThe format of
failed_request_status_codeshas changed from a list of integers and containers to a set:sentry_sdk.init( integrations=StarletteIntegration( failed_request_status_codes={403, *range(500, 600)}, ), )The old way of defining
failed_request_status_codeswill continue to work for the time being. Examples of valid new-stylefailed_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. -
-
FastAPI/Starlette: Fix
failed_request_status_codes=[](#​3561) by @​szokeasaurusrex -
FastAPI/Starlette: Remove invalid
failed_request_status_codetests (#​3560) by @​szokeasaurusrex -
FastAPI/Starlette: Refactor shared test parametrization (#​3562) by @​szokeasaurusrex
Miscellaneous
- Deprecate
sentry_sdk.metrics(#​3512) by @​szokeasaurusrex - Add
nameparameter tostart_span()and deprecatedescriptionparameter (#​3524 & #​3525) by @​antonpirker - Fix
add_query_sourcewith modules outside of project root (#​3313) by @​rominf - Test more integrations on 3.13 (#​3578) by @​sentrivana
- Fix trailing whitespace (#​3579) by @​sentrivana
- Improve
get_integrationtyping (#​3550) by @​szokeasaurusrex - Make import-related tests stable (#​3548) by @​BYK
- Fix breadcrumb sorting (#​3511) by @​sentrivana
- Fix breadcrumb timestamp casting and its tests (#​3546) by @​BYK
- Don't use deprecated
logger.warn(#​3552) by @​sentrivana - Fix Cohere API change (#​3549) by @​BYK
- Fix deprecation message (#​3536) by @​antonpirker
- Remove experimental
explain_planfeature. (#​3534) by @​antonpirker - X-fail one of the Lambda tests (#​3592) by @​antonpirker
- Update Codecov config (#​3507) by @​antonpirker
- Update
actions/upload-artifacttov4with merge (#​3545) by @​joshuarli - Bump
actions/checkoutfrom4.1.7to4.2.0(#​3585) by @​dependabot
v2.14.0
Various fixes & improvements
-
New
SysExitIntegration(#​3401) by @​szokeasaurusrexFor more information, see the documentation for the SysExitIntegration.
-
Add
SENTRY_SPOTLIGHTenv variable support (#​3443) by @​BYK -
Support Strawberry
0.239.2(#​3491) by @​szokeasaurusrex -
Add separate
pii_denylisttoEventScrubberand run it always (#​3463) by @​sl0thentr0py -
Celery: Add wrapper for
Celery().send_taskto support behavior asTask.apply_async(#​2377) by @​divaltor -
Django: SentryWrappingMiddleware.init fails if super() is object (#​2466) by @​cameron-simpson
-
Fix data_category for sessions envelope items (#​3473) by @​sl0thentr0py
-
Fix non-UTC timestamps (#​3461) by @​szokeasaurusrex
-
Remove obsolete object as superclass (#​3480) by @​sentrivana
-
Replace custom
TYPE_CHECKINGwith stdlibtyping.TYPE_CHECKING(#​3447) by @​dev-satoshi -
Refactor
tracing_utils.py(#​3452) by @​rominf -
Explicitly export symbol in subpackages instead of ignoring (#​3400) by @​hartungstenio
-
Better test coverage reports (#​3498) by @​antonpirker
-
Fixed config for old coverage versions (#​3504) by @​antonpirker
-
Fix AWS Lambda tests (#​3495) by @​antonpirker
-
Remove broken Bottle tests (#​3505) by @​sentrivana
v2.13.0
Various fixes & improvements
-
New integration: Ray (#​2400) (#​2444) by @​glowskir
Usage: (add the RayIntegration to your
sentry_sdk.init()call and make sure it is called in the worker processes)import ray import sentry_sdk from sentry_sdk.integrations.ray import RayIntegration def init_sentry(): sentry_sdk.init( dsn="...", traces_sample_rate=1.0, integrations=[RayIntegration()], ) init_sentry() ray.init( runtime_env=dict(worker_process_setup_hook=init_sentry), )For more information, see the documentation for the Ray integration.
-
New integration: Litestar (#​2413) (#​3358) by @​KellyWalker
Usage: (add the LitestarIntegration to your
sentry_sdk.init())from litestar import Litestar, get import sentry_sdk from sentry_sdk.integrations.litestar import LitestarIntegration sentry_sdk.init( dsn="...", traces_sample_rate=1.0, integrations=[LitestarIntegration()], ) @​get("/") async def index() -> str: return "Hello, world!" app = Litestar(...)For more information, see the documentation for the Litestar integration.
-
New integration: Dramatiq from @​jacobsvante (#​3397) by @​antonpirker Usage: (add the DramatiqIntegration to your
sentry_sdk.init())import dramatiq import sentry_sdk from sentry_sdk.integrations.dramatiq import DramatiqIntegration sentry_sdk.init( dsn="...", traces_sample_rate=1.0, integrations=[DramatiqIntegration()], ) @​dramatiq.actor(max_retries=0) def dummy_actor(x, y): return x / y dummy_actor.send(12, 0)For more information, see the documentation for the Dramatiq integration.
-
New config option: Expose
custom_reprfunction that precedessafe_reprinvocation in serializer (#​3438) by @​sl0thentr0pySee: https://docs.sentry.io/platforms/python/configuration/options/#custom-repr
-
Profiling: Add client SDK info to profile chunk (#​3386) by @​Zylphrex
-
Serialize vars early to avoid living references (#​3409) by @​sl0thentr0py
-
Deprecate hub-based
sessions.pylogic (#​3419) by @​szokeasaurusrex -
Deprecate
is_auto_session_tracking_enabled(#​3428) by @​szokeasaurusrex -
Add note to generated yaml files (#​3423) by @​sentrivana
-
Slim down PR template (#​3382) by @​sentrivana
-
Use new banner in readme (#​3390) by @​sentrivana
v2.12.0
Various fixes & improvements
- API: Expose the scope getters to top level API and use them everywhere (#​3357) by @​sl0thentr0py
- API:
push_scopedeprecation warning (#​3355) (#​3355) by @​szokeasaurusrex - API: Replace
push_scope(#​3353, #​3354) by @​szokeasaurusrex - API: Deprecate, avoid, or stop using
configure_scope(#​3348, #​3349, #​3350, #​3351) by @​szokeasaurusrex - OTel: Remove experimental autoinstrumentation (#​3239) by @​sentrivana
- Graphene: Add span for grapqhl operation (#​2788) by @​czyber
- AI: Add async support for
ai_trackdecorator (#​3376) by @​czyber - CI: Workaround bug preventing Django test runs (#​3371) by @​szokeasaurusrex
- CI: Remove Django setuptools pin (#​3378) by @​szokeasaurusrex
- Tests: Test with Django 5.1 RC (#​3370) by @​sentrivana
- Broaden
add_attachmenttype (#​3342) by @​szokeasaurusrex - Add span data to the transactions trace context (#​3374) by @​antonpirker
- Gracefully fail attachment path not found case (#​3337) by @​sl0thentr0py
- Document attachment parameters (#​3342) by @​szokeasaurusrex
- Bump checkouts/data-schemas from
0feb234to6d2c435(#​3369) by @​dependabot - Bump checkouts/data-schemas from
88273a9to0feb234(#​3252) by @​dependabot
v2.11.0
Various fixes & improvements
-
Add
disabled_integrations(#​3328) by @​sentrivanaDisabling individual integrations is now much easier. Instead of disabling all automatically enabled integrations and specifying the ones you want to keep, you can now use the new
disabled_integrationsconfig option to provide a list of integrations to disable:import sentry_sdk from sentry_sdk.integrations.flask import FlaskIntegration sentry_sdk.init(
Do not use the Flask integration even if Flask is installed.
disabled_integrations=[
FlaskIntegration(),
],
)
- Use operation name as transaction name in Strawberry (#​3294) by @​sentrivana
- WSGI integrations respect `SCRIPT_NAME` env variable (#​2622) by @​sarvaSanjay
- Make Django DB spans have origin `auto.db.django` (#​3319) by @​antonpirker
- Sort breadcrumbs by time before sending (#​3307) by @​antonpirker
- Fix `KeyError('sentry-monitor-start-timestamp-s')` (#​3278) by @​Mohsen-Khodabakhshi
- Set MongoDB tags directly on span data (#​3290) by @​0Calories
- Lower logger level for some messages (#​3305) by @​sentrivana and @​antonpirker
- Emit deprecation warnings from `Hub` API (#​3280) by @​szokeasaurusrex
- Clarify that `instrumenter` is internal-only (#​3299) by @​szokeasaurusrex
- Support Django 5.1 (#​3207) by @​sentrivana
- Remove apparently unnecessary `if` (#​3298) by @​szokeasaurusrex
- Preliminary support for Python 3.13 (#​3200) by @​sentrivana
- Move `sentry_sdk.init` out of `hub.py` (#​3276) by @​szokeasaurusrex
- Unhardcode integration list (#​3240) by @​rominf
- Allow passing of PostgreSQL port in tests (#​3281) by @​rominf
- Add tests for `@ai_track` decorator (#​3325) by @​colin-sentry
- Do not include type checking code in coverage report (#​3327) by @​antonpirker
- Fix test_installed_modules (#​3309) by @​szokeasaurusrex
- Fix typos and grammar in a comment (#​3293) by @​szokeasaurusrex
- Fixed failed tests setup (#​3303) by @​antonpirker
- Only assert warnings we are interested in (#​3314) by @​szokeasaurusrex
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
â™» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.