Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,6 @@ def register_temporary_features(manager: FeatureManager) -> None:
manager.add("organizations:explore-automatic-json-expansion-ui", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable trace metrics multi-metric selection in dashboards
manager.add("organizations:tracemetrics-multi-metric-selection-in-dashboards", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable trace metrics units in trace view UI
manager.add("organizations:tracemetrics-units-ui", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable trace metrics showing stats bytes
manager.add("organizations:tracemetrics-stats-bytes-ui", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
Comment on lines 475 to 476

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.

# Enable trace metrics showing pii scrubbing
Expand Down
Loading