File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -934,7 +934,7 @@ def _capture_log(self, log: "Optional[Log]") -> None:
934934 log ["attributes" ]["sentry.trace.parent_span_id" ] = span_id
935935
936936 # The user, if present, is always set on the isolation scope.
937- if isolation_scope ._user is not None :
937+ if self . should_send_default_pii () and isolation_scope ._user is not None :
938938 for log_attribute , user_attribute in (
939939 ("user.id" , "id" ),
940940 ("user.name" , "username" ),
@@ -998,7 +998,7 @@ def _capture_metric(self, metric: "Optional[Metric]") -> None:
998998 if span_id is not None :
999999 metric ["span_id" ] = span_id
10001000
1001- if isolation_scope ._user is not None :
1001+ if self . should_send_default_pii () and isolation_scope ._user is not None :
10021002 for metric_attribute , user_attribute in (
10031003 ("user.id" , "id" ),
10041004 ("user.name" , "username" ),
You can’t perform that action at this time.
0 commit comments