Skip to content

Commit 2202e0c

Browse files
committed
set attrs directly on span, not scope
1 parent 77b9298 commit 2202e0c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sentry_sdk/integrations/asgi.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,13 @@ async def _run_app(
307307
else nullcontext()
308308
)
309309

310-
for attribute, value in _get_request_attributes(scope).items():
311-
sentry_scope.set_attribute(attribute, value)
312-
313310
with span_ctx as span:
311+
if isinstance(span, StreamedSpan):
312+
for attribute, value in _get_request_attributes(
313+
scope
314+
).items():
315+
span.set_attribute(attribute, value)
316+
314317
try:
315318

316319
async def _sentry_wrapped_send(

0 commit comments

Comments
 (0)