Skip to content
Closed
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
6 changes: 5 additions & 1 deletion sentry_sdk/integrations/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ async def _run_app(self, scope, receive, send, asgi_version):

method = scope.get("method", "").upper()
should_trace = method in self.http_methods_to_capture
with sentry_sdk.continue_trace(_get_headers(scope)):
with (
sentry_sdk.continue_trace(_get_headers(scope))
if should_trace
else nullcontext()
):
with (
sentry_sdk.start_span(
op=(
Expand Down
Loading