Skip to content

Commit 99220b6

Browse files
chore(starlette): Disable middleware spans by default (#5224)
Closes #5109
1 parent 428f1de commit 99220b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sentry_sdk/integrations/starlette.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(
8989
self,
9090
transaction_style="url", # type: str
9191
failed_request_status_codes=_DEFAULT_FAILED_REQUEST_STATUS_CODES, # type: Union[Set[int], list[HttpStatusCodeRange], None]
92-
middleware_spans=True, # type: bool
92+
middleware_spans=False, # type: bool
9393
http_methods_to_capture=DEFAULT_HTTP_METHODS_TO_CAPTURE, # type: tuple[str, ...]
9494
):
9595
# type: (...) -> None

tests/integrations/starlette/test_starlette.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ def test_user_information_transaction_no_pii(sentry_init, capture_events):
646646
def test_middleware_spans(sentry_init, capture_events):
647647
sentry_init(
648648
traces_sample_rate=1.0,
649-
integrations=[StarletteIntegration()],
649+
integrations=[StarletteIntegration(middleware_spans=True)],
650650
)
651651
starlette_app = starlette_app_factory(
652652
middleware=[Middleware(AuthenticationMiddleware, backend=BasicAuthBackend())]

0 commit comments

Comments
 (0)