Skip to content

feat(tracemetrics): Add skeleton for equation builder in Explore#112504

Merged
narsaynorath merged 13 commits intomasterfrom
nar/feat/tracemetrics-add-equation-ui-to-explore
Apr 9, 2026
Merged

feat(tracemetrics): Add skeleton for equation builder in Explore#112504
narsaynorath merged 13 commits intomasterfrom
nar/feat/tracemetrics-add-equation-ui-to-explore

Conversation

@narsaynorath
Copy link
Copy Markdown
Member

@narsaynorath narsaynorath commented Apr 8, 2026

Adds the basic skeleton code to just get a new field rendering in the right spot. i.e.

  • Adds a new "Add Equation" button that's feature flagged
  • Relaxes a bunch of types to allow for VisualizeEquation as an option
  • "Add Metric" adds a chart between the equations and metrics. If there's no equations, it just appends to the end
  • "Add Equation" always appends an empty equation at the end
  • Metrics appear as references in the equation builder UI
    • ⚠️ the references are currently not stable. i.e. I have not handled deletion properly so the equation will not update to maintain the references if labels have to "shift left" to accommodate for deleting. This will be a follow up PR since I think it's a separate concern than this PR is addressing
  • Equations show their raw expression text as a label
  • Users can delete the equation

The code currently does not make a request to the backend properly. Expanding the equation references will happen in a following PR.

The feature flag needed to see this is: tracemetrics-equations-in-explore

Screen.Recording.2026-04-08.at.3.13.05.PM.mov

@narsaynorath narsaynorath requested a review from a team as a code owner April 8, 2026 19:21
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 8, 2026
Comment thread static/app/views/explore/metrics/metricsQueryParams.tsx
Comment thread static/app/views/explore/metrics/multiMetricsQueryParams.tsx Outdated
Comment thread static/app/views/explore/metrics/multiMetricsQueryParams.tsx Outdated
Comment thread static/app/views/explore/metrics/metricToolbar/index.tsx
Copy link
Copy Markdown
Member

@k-fish k-fish left a comment

Choose a reason for hiding this comment

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

I don't see anything major, lgtm mostly looking at the feature flag boundary. Maybe get Nick to take a look too since he's touched this UI code more recently, he might spot anything amiss.

Comment thread static/app/views/explore/metrics/hooks/useHasMetricEquations.tsx Outdated
Comment thread static/app/views/explore/hooks/useAnalytics.tsx Outdated
Comment thread static/app/views/explore/metrics/metricToolbar/aggregateDropdown.tsx Outdated
Comment thread static/app/views/explore/metrics/metricQuery.tsx
Comment thread static/app/views/explore/metrics/metricsTab.tsx Outdated
Comment thread static/app/views/explore/metrics/multiMetricsQueryParams.spec.tsx
Copy link
Copy Markdown
Contributor

@nsdeschenes nsdeschenes left a comment

Choose a reason for hiding this comment

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

UI things all look good to me 👍

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 920ecbd. Configure here.

Comment thread static/app/views/explore/metrics/metricQuery.tsx Outdated
Comment thread static/app/views/explore/metrics/hooks/useMetricReferences.tsx Outdated
Copy link
Copy Markdown
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

@narsaynorath narsaynorath merged commit 884ade1 into master Apr 9, 2026
65 checks passed
@narsaynorath narsaynorath deleted the nar/feat/tracemetrics-add-equation-ui-to-explore branch April 9, 2026 19:06
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
…2504)

Adds the basic skeleton code to just get a new field rendering in the
right spot. i.e.

- Adds a new "Add Equation" button that's feature flagged
- Relaxes a bunch of types to allow for `VisualizeEquation` as an option
- "Add Metric" adds a chart _between_ the equations and metrics. If
there's no equations, it just appends to the end
- "Add Equation" always appends an empty equation at the end
- Metrics appear as references in the equation builder UI
- ⚠️ the references are currently __not__ stable. i.e. I have not
handled deletion properly so the equation will not update to maintain
the references if labels have to "shift left" to accommodate for
deleting. This will be a follow up PR since I think it's a separate
concern than this PR is addressing
- Equations show their raw expression text as a label
- Users can delete the equation 

The code currently **does not** make a request to the backend properly.
Expanding the equation references will happen in a following PR.

The feature flag needed to see this is:
`tracemetrics-equations-in-explore`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants