From 2ce955a8ed3e1f12b576a233646e681b43c16d58 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Wed, 17 May 2023 12:00:30 +0200 Subject: [PATCH] This disables Django Cache spans by default. (#2120) * Made Django Cache spans disabled by default --- sentry_sdk/integrations/django/__init__.py | 2 +- tests/integrations/django/test_basic.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sentry_sdk/integrations/django/__init__.py b/sentry_sdk/integrations/django/__init__.py index 3560d24409..16db058d29 100644 --- a/sentry_sdk/integrations/django/__init__.py +++ b/sentry_sdk/integrations/django/__init__.py @@ -103,7 +103,7 @@ def __init__( transaction_style="url", middleware_spans=True, signals_spans=True, - cache_spans=True, + cache_spans=False, ): # type: (str, bool, bool, bool) -> None if transaction_style not in TRANSACTION_STYLE_VALUES: diff --git a/tests/integrations/django/test_basic.py b/tests/integrations/django/test_basic.py index ab15dabb5c..006c63ea13 100644 --- a/tests/integrations/django/test_basic.py +++ b/tests/integrations/django/test_basic.py @@ -1017,8 +1017,6 @@ def test_cache_spans_middleware( use_django_caching_with_middlewares, settings, ): - client.application.load_middleware() - sentry_init( integrations=[ DjangoIntegration( @@ -1029,6 +1027,8 @@ def test_cache_spans_middleware( ], traces_sample_rate=1.0, ) + + client.application.load_middleware() events = capture_events() client.get(reverse("not_cached_view"))