From 92c5454202315fd28bdf57b7044cee6e5e95b4e5 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 11 Dec 2025 15:10:22 +0100 Subject: [PATCH 1/2] chore(django): Disable middleware spans by default --- sentry_sdk/integrations/django/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry_sdk/integrations/django/__init__.py b/sentry_sdk/integrations/django/__init__.py index 5a808a53cb..41aaecc71a 100644 --- a/sentry_sdk/integrations/django/__init__.py +++ b/sentry_sdk/integrations/django/__init__.py @@ -130,7 +130,7 @@ class DjangoIntegration(Integration): def __init__( self, transaction_style="url", # type: str - middleware_spans=True, # type: bool + middleware_spans=False, # type: bool signals_spans=True, # type: bool cache_spans=False, # type: bool db_transaction_spans=False, # type: bool From a674e1710d7cda59f4dd3ca5ab33f7d8d10955fc Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Fri, 12 Dec 2025 09:57:52 +0100 Subject: [PATCH 2/2] tests --- tests/integrations/django/test_basic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integrations/django/test_basic.py b/tests/integrations/django/test_basic.py index bbe29c7238..40a6c84810 100644 --- a/tests/integrations/django/test_basic.py +++ b/tests/integrations/django/test_basic.py @@ -1023,7 +1023,7 @@ def test_render_spans_queryset_in_data(sentry_init, client, capture_events): def test_middleware_spans(sentry_init, client, capture_events, render_span_tree): sentry_init( integrations=[ - DjangoIntegration(signals_spans=False), + DjangoIntegration(middleware_spans=True, signals_spans=False), ], traces_sample_rate=1.0, ) @@ -1040,7 +1040,7 @@ def test_middleware_spans(sentry_init, client, capture_events, render_span_tree) def test_middleware_spans_disabled(sentry_init, client, capture_events): sentry_init( integrations=[ - DjangoIntegration(middleware_spans=False, signals_spans=False), + DjangoIntegration(signals_spans=False), ], traces_sample_rate=1.0, )