Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This disables Django Cache spans by default. #2120

Merged
merged 2 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/integrations/django/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,6 @@ def test_cache_spans_middleware(
use_django_caching_with_middlewares,
settings,
):
client.application.load_middleware()

sentry_init(
integrations=[
DjangoIntegration(
Expand All @@ -1029,6 +1027,8 @@ def test_cache_spans_middleware(
],
traces_sample_rate=1.0,
)

client.application.load_middleware()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By changing the default it was uncovered, that this test only worked by coincidence. Had to load the middleware after sdk init, to have the options set in DjangoIntegration.

events = capture_events()

client.get(reverse("not_cached_view"))
Expand Down