Skip to content

feat(user): Add deprecated sentry.user.* attributes - #406

Merged
mjq merged 1 commit into
mainfrom
mjq/user-deprecations
May 29, 2026
Merged

feat(user): Add deprecated sentry.user.* attributes#406
mjq merged 1 commit into
mainfrom
mjq/user-deprecations

Conversation

@mjq

@mjq mjq commented May 29, 2026

Copy link
Copy Markdown
Member

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: null is 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

  • I have run yarn test and verified that the tests pass.
  • I have run yarn generate to generate and format code and docs.

If an attribute was added:

  • I have used the correct value for pii (i.e. maybe or true. Use false only 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.

@mjq
mjq requested review from a team, Lms24, cleptric and nsdeschenes as code owners May 29, 2026 15:17
@github-actions

github-actions Bot commented May 29, 2026

Copy link
Copy Markdown

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Docs

  • Add links to deprecated and aliased attributes by Lms24 in #396
  • Add filtering capability by nsdeschenes in #395

Other

  • (user) Add deprecated sentry.user.* attributes by mjq in #406

Bug Fixes 🐛

  • Change type of sentry.dsc.project_id to string by elramen in #400

Internal Changes 🔧

  • (generate) Remove deprecated attributes JSON generation by mjq in #404
  • (publish) Automatically add PR numbers to attribute changelogs by Lms24 in #402

🤖 This preview updates automatically when you update the PR.

@linear-code

linear-code Bot commented May 29, 2026

Copy link
Copy Markdown

CON-95

@mjq
mjq merged commit 6fd26c8 into main May 29, 2026
17 checks passed
@mjq
mjq deleted the mjq/user-deprecations branch May 29, 2026 17:10
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set up deprecated attributes for old sentry.user.* attributes

2 participants