Skip to content

Improve data-sentry-label granularity and add inp.category grouping for Sentry INP #105513

Open
6 of 7 issues completed

Description

@MelvinBot

Background

Fix Sentry not using data-sentry-label restored data-sentry-label on Sentry INP spans. This issue makes those labels more useful by giving them finer detail and grouping them into categories, so the INP dashboard can show aggregated INP per interaction group.

Part of [Sentry] Extending Sentry Analysis to Systematically Reduce High INP Events.

Plan

  1. Add inp.category to Sentry INP spans. Add a beforeSendSpan middleware in src/libs/telemetry/middlewares/ and wire it into Sentry.init(). For spans whose op starts with ui.interaction.:

    • Read the label from the description with /\[data-sentry-label="([^"]+)"\]/. Don't split the raw description, because it's a CSS selector.
    • If the label follows <Area>-<Action>-<Detail>, set span.data['inp.category'] to <Area>-<Action>. Use span.data, not span.attributes.
    • Cover the logic with unit tests.
  2. Add a table widget to the Sentry INP dashboard. Filter by has:inp.category and group by inp.category to show aggregated INP per group.

  3. Update existing labels from the FullStory list. For example, split Search-ActionCellAction into Search-ActionCellAction-Submit, -Approve, -Pay and so on. Existing 3-part labels such as SelectionList-ListHeader-SelectAll will become categories automatically; rename them or accept that. List the renamed labels in the PR, since they lose their history.

  4. Add the missing labels from the FullStory list.

  5. Document data-sentry-label in contributingGuides/INP_IMPROVEMENT_WORKFLOW.md, or a doc linked from it. Cover the naming schema, how inp.category is derived, and the rule that labels contain no IDs or user data.

  6. Cover Button, MenuItem and other components that wrap pressables and pass sentryLabel to them. Add the missing labels, and extend the existing no-restricted-syntax rule in config/eslint/eslint.config.mjs so it also requires sentryLabel on these components. It currently only checks direct Pressable* usages.

Requested by GCyganek in this comment.

Issue OwnerCurrent Issue Owner: @GCyganek

Activity

  1. GCyganek commented on Oct 30, 2026

    @GCyganek
    Contributor

    @MelvinBot please assign me to this issue as I will start working on it soon

  2. MelvinBot commented on Oct 30, 2026

    @MelvinBot
    ContributorAuthor

    Done. I assigned you (GCyganek) to this issue.


    view run

  3. GCyganek commented on Oct 30, 2026

    @GCyganek
    Contributor

    Currently required changes for FullStory:

  4. self-assigned this
    on Oct 30, 2026
  5. mountiny commented on Oct 30, 2026

    @mountiny
    Contributor

    @GCyganek thanks! Could we also add something to the AGENTS.md so the ai would already create the labels for new components in correct way?

  6. mountiny commented on Nov 2, 2026

    @mountiny
    Contributor

    @GCyganek I think this wont need a C+, can you make sure to test thoroughly and then if C+ is autoassigned, ask them not to review, unless you think something will require good thorough review and testing

  7. GCyganek commented on Nov 2, 2026

    @GCyganek
    Contributor

    @mountiny will do, thanks for creating sub-issues!

  8. GCyganek commented on Nov 3, 2026

    @GCyganek
    Contributor

    @MelvinBot please verify these findings related to Sentry labels that are built from runtime values, labels hardcoded outside CONST.SENTRY_LABEL, labels that don't follow the data-sentry-label schema:

    1. User data in labels (highest priority)

    • src/components/Switch.tsx: sentryLabel={enhancedAccessibilityLabel} reuses the translated accessibility label, and several callers put user data in it:

      • tag, category and vendor names: WorkspaceTagsTableRow.tsx, WorkspaceCategoriesTableRow.tsx, WorkspaceVendorsTable/index.tsx
      • report field list values: WorkspaceReportFieldListValuesTableRow.tsx
      • distance rate name: WorkspaceDistanceRatesTableRow.tsx
      • beta name: DynamicBetaOverridesPage.tsx

      On web this reaches Sentry and FullStory as data-sentry-label, and each locale becomes its own series.
      Fix: make sentryLabel a required Switch prop and pass a CONST.SENTRY_LABEL value at every call site (about 45).

    2. Labels built at runtime

    • src/pages/signin/Socials.tsx: `${CONST.SENTRY_LABEL.SOCIALS.LINK}-${social.iconURL}`. The values are safe (a fixed icon union) but aren't in CONST. Add one CONST entry per social link and drop the Socials- allowlist prefix.

    • src/pages/signin/SignInPageLayout/FooterRow/index.native.tsx: sentryLabel={translationPath} produces dotted translation keys, which native drops. The web FooterRow/index.tsx has no label at all.

    • src/pages/workspace/merge/MergeSyncResultsPageBase.tsx: `${testID}-SkippedEmployees` builds the label from the testID. Use two CONST entries (HR and Recruiting).

    • src/components/TextInput/BaseTextInput/implementation/index.tsx: `${sentryLabel}-ClearButton` adds a new part, which changes the inp.category. SENTRY_LABEL.md says to use ${sentryLabel}ClearButton. The -ClearButton suffix in the native allowlist has the same mistake. Renaming will lose Sentry history.

    • Search filters build labels from filter keys:

      • `Search-Filter-${filterKey}` in useSearchFiltersBar.tsx
      • `Search-Advanced-Filter-${filterKey}` in FilterList.tsx. This has 4 parts, so it gets no inp.category.
      • `Search-FilterPopupApply-${baseFilterKey}` in ListPopup.tsx, TextFilterPopup.tsx and MerchantFilterPopup.tsx

      Risk: SearchAdvancedFiltersKey includes reportField-<fieldName>, and field names are defined by each policy, so they can be user data. The filter bar currently groups report fields under report-field, so nothing leaks today. But the native allowlist accepts anything after these prefixes, so nothing would catch a future leak. Consider a CONST map keyed by filter key.

    3. Hardcoded strings not in CONST.SENTRY_LABEL (dropped on native)

    • TestToolsModalNavigator-Dismiss (TestToolsModalNavigator.tsx)
    • Banner-Close (Banner.tsx)
    • RadioButtonWithLabel (RadioButtonWithLabel.tsx)
    • TestToolsModalPage-ReleaseOptions (TestToolsModalPage.tsx)
    • FeedSelector (FeedSelector.tsx)
    • OnboardingHeader-Back (OnboardingHeader.tsx)
    • GrowlNotification-Dismiss, GrowlNotification-Action (GrowlNotificationContent.tsx)
    • CenteredModalLayout-backdrop (CenteredModalLayoutOverlay/index.native.tsx): lowercase
    • SearchStaticList-item, SearchStaticList-wide-item (SearchStaticList.tsx): lowercase
    • SearchAdvancedFiltersPopup-DescribeSearch (SearchAdvancedFiltersPopup/index.tsx)
    • DateSelectPopup-Back (SelectedDateModifierHeader.tsx)
    • MapView-ToggleDistanceUnit (DistanceSymbolMarker.web.tsx)
    • DistanceRequestFooter-AddStop, DistanceRequestFooter-ReuseRoute (DistanceRequestFooter.tsx)
    • PopoverMenu.DismissButton (PopoverMenu/v2/content/DismissButton.tsx): uses a dot
    • InsightsChartMenu (InsightsChartWidget.tsx)
    • TwoFactorAuthSecret-Copy (TwoFactorAuthSecretDisplay.tsx)
    • EditAgentAvatar-BotAvatarSelector (DynamicEditAgentAvatarPage.tsx)
    • HomeSectionExpandToggle (HomeSectionExpandToggle.tsx)
    • InsightsOverflowMenu (InsightsSectionContent.tsx)
    • InsightTitleDropdown (InsightTitleDropdown.tsx)
    • RecentlyAddedRow (RecentlyAddedRow.tsx)
    • RecentlyAddedOverflowMenu (RecentlyAddedSection/index.tsx)
    • ConciergeThinkingMessage-ToggleReasoning (ConciergeThinkingMessage.tsx)
    • ImportFromFileStep-TemplateLink, ImportFromFileStep-HelpGuideLink (ImportFromFileStep.tsx)
    • SearchAdvancedFiltersBase-DescribeSearch (SearchAdvancedFiltersBase.tsx)

    Labels with only one part (FeedSelector, InsightsChartMenu, RecentlyAddedRow, ...) also break the <Area>-<Action> schema.

    4. CONST values that break the schema

    • MAP_VIEW.COMPASS: 'compass': lowercase, one part
    • SOCIALS.LINK: 'Socials': one part
    • UNREPORTED_EXPENSE_LIST_ITEM: 'UnreportedExpenseListItem': one part
    • MONEY_REQUEST_REPORT_TRANSACTION_ITEM: 'MoneyRequestReportTransactionItem': one part

    5. Unused CONST labels (the elements may have lost their labels in a refactor)

    • WORKSPACE.INITIAL.ACCOUNTING, HR, RECRUITING, RECEIPT_PARTNERS, MCP. The workspace "Accounting" item now uses CONNECTIONS.
    • WORKSPACE.ACCOUNTING.SETUP_BUTTON, WORKSPACE.ACCOUNTING.THREE_DOT_MENU
    • WORKSPACE_EXPENSIFY_CARD.CARD_LIST_ROW
    • WORKSPACE.RULES.REQUIRE_FIELDS_RULE_FIELD_TOGGLE. This is the intended label for the switch in FieldRequirementSettingRow.tsx.

    Create a sub-issue to fix these labels

  9. MelvinBot commented on Nov 3, 2026

    @MelvinBot
    ContributorAuthor

    I created [INP] Fix data-sentry-label values that use runtime data or break the label schema as a sub-issue and assigned it to you. Most findings are correct. The new issue includes these corrections and additions:

    • Switch, beta names: DynamicBetaOverridesPage uses CONST.BETAS values, so it leaks no user data. It still breaks the schema.
    • Switch, missed leak: ToggleSettingsOptionRow.tsx:227-231 passes accounting field names (Campfire, Rillet, DualEntry, Zoho, Business Central) and subtitles into the Switch label. There are 44 direct <Switch sites, plus switchProps objects passed to ButtonWithDropdownMenu.
    • Search filters: the report-field group key is reportField, not report-field. Nothing leaks today.
    • ClearButton: native passes no label to its clear button, so the native -ClearButton suffix matches nothing.
    • Missed items: ConciergePromptBox-AddAttachment and ConciergePromptBox-Send, Workspace-CompanyCards-TableItem, and 5 more unused WORKSPACE.RULES keys.

    view run

  10. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    @mountiny @GCyganek

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.34-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

  11. mountiny commented on Nov 10, 2026

    @mountiny
    Contributor

    We are chugging through the PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions