feat(user): Add deprecated sentry.user.* attributes - #406
Merged
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Docs
Other
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
nsdeschenes
approved these changes
May 29, 2026
4 tasks
mjq
added a commit
to getsentry/sentry
that referenced
this pull request
May 29, 2026
) Currently v1 (transaction-based) spans send user attributes in `sentry.user.*` attributes, while v2 (streaming) spans send user attributes in conventions-defined `user.*` attributes. Only the v1 attributes are currently propagated, meaning that child spans from span streaming SDKs are missing user info. We can use our conventions' deprecation mechanism (getsentry/sentry-conventions#406) to make queries backwards compatible, but that doesn't affect segment enrichment which reads data directly from spans. For now, propagate both the old v1 user attributes and the new v2 user attributes to children. Once that's done, EAP's attribute coalescing (via above deprecation PR) will take care of the rest. Next steps will be to clean up our use of the v1 `sentry.user.*` attributes in Relay and Sentry, at which point we can stop propagating them. (That work is tracked in BROWSE-535). Fixes BROWSE-532. --- 🤖: Claude Code (Opus 4.6) used to generate the tests. I made the code changes and reviewed the tests. Words my own.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
V1 spans write user information to
sentry.user.-prefixed attributes instead of our conventional attributes. (With getsentry/relay#6030 we will start writing them to their conventional names as well going forward, but that doesn't help for backward compatibility.)V2 spans only have the new, conventional attribute names. But, Sentry is currently still querying for the old
sentry.user.-prefixed ones.By adding these deprecated attributes, EAP will start coalescing queries to handle either attribute name. This will fix user attribute searches for V2 spans and give us backwards compatibility as we switch everything over to use the new conventional names.
Note that
_status: nullis fine for the deprecations -backfill, etc are only used by the v2 pipeline, and v2 spans never have these deprecated attributes.Fixes #405, CON-95.
PR Checklist
yarn testand verified that the tests pass.yarn generateto generate and format code and docs.If an attribute was added:
pii(i.e.maybeortrue. Usefalseonly for values that should never be scrubbed such as IDs)🤖: Used Claude Code (Opus 4.6) to help generate the JSON. Reviewed by hand. Words my own.