Split from #1024.
Add user attribute enrichment behavior in sentry-core so emitted metrics include selected user attributes only when send_default_pii is enabled, aligned with user attributes. Attach user.id, user.name, and user.email only when send_default_pii is true, and preserve explicitly set metric attributes instead of overwriting them. Focus on the relevant metric scope application code in sentry-core/src/scope/real.rs, sentry-core/src/scope/noop.rs, and sentry-core/src/client.rs. Add tests for user attributes omitted when send_default_pii is false, user attributes attached when send_default_pii is true, and explicitly set user.* metric attributes not overwritten by scope user data. Do not include tracing association, default attribute enrichment, or callback processing in this issue.
If code is reused from #997, include Co-authored-by: Joris Bayer <joris.bayer@sentry.io> in commit trailers.
Split from #1024.
Add user attribute enrichment behavior in
sentry-coreso emitted metrics include selected user attributes only whensend_default_piiis enabled, aligned with user attributes. Attachuser.id,user.name, anduser.emailonly whensend_default_piiistrue, and preserve explicitly set metric attributes instead of overwriting them. Focus on the relevant metric scope application code insentry-core/src/scope/real.rs,sentry-core/src/scope/noop.rs, andsentry-core/src/client.rs. Add tests for user attributes omitted whensend_default_piiisfalse, user attributes attached whensend_default_piiistrue, and explicitly setuser.*metric attributes not overwritten by scope user data. Do not include tracing association, default attribute enrichment, or callback processing in this issue.If code is reused from #997, include
Co-authored-by: Joris Bayer <joris.bayer@sentry.io>in commit trailers.