Skip to content

ref(flags): Remove organizations:tracemetrics-units-ui registration - #126379

Open
cursor[bot] wants to merge 1 commit into
masterfrom
claude-rm-tracemetrics-units-ui-registration
Open

cursor[bot] wants to merge 1 commit into
masterfrom
claude-rm-tracemetrics-units-ui-registration

Conversation

@cursor

@cursor cursor Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Remove organizations:tracemetrics-units-ui. This flag was fully rolled out in the automator in PR #6714 on 3/5 (a Complete segment with no conditions at rollout: 100), and hasn't been touched since.

Merge last. The frontend reads are removed by #126378 and the automator value by getsentry/sentry-options-automator#10025. This PR should land after that automator removal has deployed to every region, otherwise features.has falls back to the registered default=False while the frontend is still reading the flag.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Open in Web View Automation 

The flag was fully rolled out and its frontend reads and automator value
are removed, so the registration is no longer needed.

Co-authored-by: charlie.luo <charlie.luo@sentry.io>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 2, 2026
@cursor
cursor Bot marked this pull request as ready for review October 2, 2026 20:50

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@getsentry/data-browsing @getsentry/app-backend — review please. data-browsing is the flag's owner.team in flagpole; src/sentry/features/ has no CODEOWNERS entry, so tagging app-backend as the usual backend reviewer for registration-only removals.

⚠️ This is the last of three PRs — please do not merge it ahead of the other two.

  1. #126378 — collapses the 5 frontend reads to true, deletes the useHasMetricUnitsUI hook. Green and out of draft.
  2. getsentry/sentry-options-automator#10025 — removes the flagpole value. Green and out of draft.
  3. This PR — removes the manager.add registration. Should land only after #10025 has deployed to every region.

The ordering matters because the registration carries no default= kwarg, so it defaults to False. If this merged while the frontend still read the flag, those reads would silently flip off. Removing the reads first (#126378) makes the rest inert.

Why true was the right collapse value: the flagpole block ends in a Complete segment with conditions: [] and rollout: 100, so it already matched every org. That went in via automator#6714 on 3/5 and nothing has touched the flag since (created by automator#6399 on 2/25).

Scope is one manager.add line plus its comment. No references in tests/, none in getsentry, and the flag is not in the getsentry sentry-options schema.

CI: 70 passing / 13 skipped / 1 neutral. The single red check, getsentry dispatch, is the author-permission gate (cursor[bot] lacks write permission) rather than a real failure — a collaborator needs to add the Trigger: getsentry tests label to run the downstream getsentry suite.

View PR

Open in Web View Automation 

Sent by Cursor Automation: Feature flag cleanup

Comment on lines 475 to 476
# Enable trace metrics showing stats bytes
manager.add("organizations:tracemetrics-stats-bytes-ui", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Removing the tracemetrics-units-ui feature flag from the backend will cause the frontend useHasMetricUnitsUI hook to always return false, disabling metric unit features.
Severity: HIGH

Suggested Fix

This pull request should not be merged until the corresponding frontend pull request, which removes all usages of the useHasMetricUnitsUI hook and the tracemetrics-units-ui feature flag, has been merged and deployed. Merging this PR first will cause a functional regression.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/sentry/features/temporary.py#L475-L476

Potential issue: The removal of the `organizations:tracemetrics-units-ui` feature flag
registration in `temporary.py` will cause it to be excluded from the API response
payload for organization features. However, the frontend hook `useHasMetricUnitsUI`
still checks for this flag's presence in `organization.features`. Since the flag will no
longer be sent, the hook will always return `false`. This will silently disable the
metric units UI, including unit badges in metric selectors, unit data in metric options
queries, and unit visualization in detector forms, for all users. This change is
dependent on a separate, unmerged PR that removes the frontend reads.

Also affects:

  • static/app/views/explore/metrics/metricToolbar/metricSelector/metricSelector.tsx:117
  • static/app/views/explore/hooks/useMetricOptions.tsx:93
  • static/app/views/detectors/components/forms/metric/metricsVisualize.tsx:55

Did we get this right? 👍 / 👎 to inform future reviews.

@getsantry

getsantry Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Oct 24, 2026

This branch has not been deployed

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

Labels

Scope: Backend Automatically applied to PRs that change backend components Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant