We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0037a4a commit 4d900caCopy full SHA for 4d900ca
1 file changed
sentry_sdk/integrations/wsgi.py
@@ -134,6 +134,13 @@ def __call__(
134
)
135
Scope.set_custom_sampling_context({"wsgi_environ": environ})
136
137
+ if should_send_default_pii():
138
+ client_ip = get_client_ip(environ)
139
+ if client_ip:
140
+ scope.set_attribute(
141
+ SPANDATA.USER_IP_ADDRESS, client_ip
142
+ )
143
+
144
span_ctx = sentry_sdk.traces.start_span(
145
name=_DEFAULT_TRANSACTION_NAME,
146
attributes={
@@ -412,8 +419,5 @@ def _get_request_attributes(
412
419
client_ip = get_client_ip(environ)
413
420
if client_ip:
414
421
attributes["client.address"] = client_ip
415
- sentry_sdk.get_isolation_scope().set_attribute(
416
- SPANDATA.USER_IP_ADDRESS, client_ip
417
- )
418
422
423
return attributes
0 commit comments