[Sentry] Introduce new tags for user segmentation#82766
[Sentry] Introduce new tags for user segmentation#82766rlinoz merged 2 commits intoExpensify:mainfrom
Conversation
|
@dominictb Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1bf9f9fa11
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const policiesCountBucket = bucketPolicyCount(activePolicies.length); | ||
| Sentry.setTag(CONST.TELEMETRY.TAG_ACTIVE_POLICY, activePolicyID); | ||
| Sentry.setTag(CONST.TELEMETRY.TAG_POLICIES_COUNT, policiesCountBucket); | ||
| Sentry.setTag(CONST.TELEMETRY.TAG_USER_ROLE, userRole); |
There was a problem hiding this comment.
Propagate new telemetry tags to child spans
Adding Sentry.setTag for user_role/personal_details_count here does not make those tags searchable on spans, because copyTagsToChildSpans only forwards a fixed whitelist and rewrites child span tags. In practice, transactions may carry the new tags but child spans will not, so filtering span data by these new segmentation tags will fail until the span-tag propagation list is updated.
Useful? React with 👍 / 👎.
| let userRole: string = CONST.POLICY.ROLE.USER; | ||
| for (const policy of Object.values(policies)) { | ||
| if (policy?.role !== CONST.POLICY.ROLE.ADMIN) { |
There was a problem hiding this comment.
Preserve auditor role in user_role tagging
The new role derivation only distinguishes admin vs user, so any account whose policy role is auditor is tagged as user. Since auditor is a first-class policy role in this codebase, this collapses distinct user segments and makes telemetry queries for auditor behavior inaccurate.
Useful? React with 👍 / 👎.
|
If this needs a reviewer, please reassign because I off-boarded |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 @rlinoz has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.3.22-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.22-4 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.22-4 🚀
|
Explanation of Change
This PR introduces two tags for better user segmentation in sentry
Fixed Issues
$ #80531
PROPOSAL:
Tests
user_roleandpersonal_details_countOffline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
user_roleandpersonal_details_countPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari