Repository navigation
ref(flags): Remove organizations:tracemetrics-units-ui registration - #126379
cursor[bot] wants to merge 1 commit into
Conversation
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>
There was a problem hiding this comment.
@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.
- #126378 — collapses the 5 frontend reads to
true, deletes theuseHasMetricUnitsUIhook. Green and out of draft. - getsentry/sentry-options-automator#10025 — removes the flagpole value. Green and out of draft.
- This PR — removes the
manager.addregistration. 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.
Sent by Cursor Automation: Feature flag cleanup
| # Enable trace metrics showing stats bytes | ||
| manager.add("organizations:tracemetrics-stats-bytes-ui", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) |
There was a problem hiding this comment.
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:117static/app/views/explore/hooks/useMetricOptions.tsx:93static/app/views/detectors/components/forms/metric/metricsVisualize.tsx:55
Did we get this right? 👍 / 👎 to inform future reviews.
|
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 "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |


Remove
organizations:tracemetrics-units-ui. This flag was fully rolled out in the automator in PR #6714 on 3/5 (aCompletesegment with no conditions atrollout: 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.hasfalls back to the registereddefault=Falsewhile 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.