Issue
I want to know why context I attach in beforeSend is present in the serialized event leaving the SDK, but missing when I view the event in Sentry.
Applies To
All SaaS Customers and Self-Hosted Users
Data Scrubbing
Security & Privacy
Symptoms
In the event JSON, under
_meta, the context shows as scrubbed with reasonstrip-fields.
Resolution
Sentry can remove the data after it’s ingested. So even if your beforeSend callback adds the context correctly, server-side scrubbing can still remove it before the event is stored.
strip-fields means the field matched one of the Global Sensitive Fields (organization level) or Additional Sensitive Fields (project level). The match can be based on either the field’s key or its value, including partial matches.
To prevent this, add the field to Safe Fields under Settings > Security & Privacy at the organization or project level. Alternatively, you can narrow or remove the sensitive-field rule that’s matching it. Keep in mind that organization-level settings take precedence over project-level settings.
For more details, see How do I find out exactly what is scrubbing my data? and Server-Side Data Scrubbing.
