Skip to content

Commit 86fd48a

Browse files
committed
dont set on scope
1 parent 6a8d60f commit 86fd48a

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

sentry_sdk/integrations/asgi.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,6 @@ 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:
314311
if isinstance(span, StreamedSpan):
315312
for attribute, value in _get_request_attributes(

sentry_sdk/integrations/wsgi.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ def __call__(
157157
custom_sampling_context={"wsgi_environ": environ},
158158
)
159159

160-
with capture_internal_exceptions():
161-
for attr, value in _get_request_attributes(
162-
environ, self.use_x_forwarded_for
163-
).items():
164-
scope.set_attribute(attr, value)
165-
166160
span_ctx = span_ctx or nullcontext()
167161

168162
with span_ctx as span:
163+
with capture_internal_exceptions():
164+
for attr, value in _get_request_attributes(
165+
environ, self.use_x_forwarded_for
166+
).items():
167+
span.set_attribute(attr, value)
168+
169169
try:
170170
response = self.app(
171171
environ,

0 commit comments

Comments
 (0)