Skip to main content

normalize_sentry_user

Function normalize_sentry_user 

Source
pub fn normalize_sentry_user(attributes: &mut Annotated<Attributes>)
Expand description

Derives the SENTRY__USER attribute from the user attributes.

Uses the first of USER__ID, USER__NAME, USER__EMAIL and USER__IP_ADDRESS, with the same format as the user tag on transactions. Values removed, replaced or masked by PII scrubbing are skipped, since they do not identify a user. Pseudonymized (hashed) values are kept.

Does not modify the attributes if SENTRY__USER is already present. This must run after PII scrubbing, so that scrubbed user attributes can be skipped.