update user context to mark 'data' keys#90993
Merged
JoshuaMoelans merged 2 commits intomasterfrom May 7, 2025
Merged
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
leeandher
approved these changes
May 6, 2025
Member
leeandher
left a comment
There was a problem hiding this comment.
makes sense! thanks for the fix 🚀
6 tasks
JoshuaMoelans
added a commit
to getsentry/sentry-docs
that referenced
this pull request
May 8, 2025
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> [Vercel Preview](https://develop-docs-bmq9r90m3.sentry.dev/sdk/data-model/event-payloads/user/) ## DESCRIBE YOUR PR Related to getsentry/sentry#90993 , where we added the prefix `data.` to all unknown User Context keys, making them stand out in the UI. It was confusing to some users that the UI showed the User data in a "prettified" manner, not matching the expected keys sent from the SDKs, so I'm adding some warnings/notes to the develop docs to clear this up. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Karl Heinz Struggl <kahest@users.noreply.github.com> Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
andrewshie-sentry
pushed a commit
that referenced
this pull request
May 12, 2025
Fixes getsentry/sentry-native#1225 For User Context, SDKs are [expected](https://develop.sentry.dev/sdk/data-model/event-payloads/user/) to send the default fields in lowercase (e.g. `username`, `email`, `ip_address`, ...) which get rendered nicely (`Username`, `Email`, `IP Address`, ...) in the Sentry UI. But, when they send us a key like`Email` this will look the same in the UI (but will not be treated the same). Hence I propose this fix which marks keys from the user context's `data` section as `data.X`. (this is just a suggestion; maybe there is a cleaner way to mark these items as "data" that has less visual clutter, so I'm open to feedback 😄 ) ```json "user": { "id": "42", "email": "john.doe@email.com", "ip_address": "127.0.0.1", "username": "John Doe", "sentry_user": "id:42", "data": { "Email": "jane.doe@email.com", "Username": "Jane Doe" } } ``` currently rendered as  newly rendered as 
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes getsentry/sentry-native#1225
For User Context, SDKs are expected to send the default fields in lowercase (e.g.
username,email,ip_address, ...) which get rendered nicely (Username,Email,IP Address, ...) in the Sentry UI. But, when they send us a key likeEmailthis will look the same in the UI (but will not be treated the same). Hence I propose this fix which marks keys from the user context'sdatasection asdata.X.(this is just a suggestion; maybe there is a cleaner way to mark these items as "data" that has less visual clutter, so I'm open to feedback 😄 )
currently rendered as
newly rendered as
