Skip to content

feat(tracemetrics): Add parser for resolved expressions#113230

Open
narsaynorath wants to merge 1 commit intomasterfrom
nar/feat/tracemetrics-alert-equations-add-parser-for-resolved-expressions
Open

feat(tracemetrics): Add parser for resolved expressions#113230
narsaynorath wants to merge 1 commit intomasterfrom
nar/feat/tracemetrics-alert-equations-add-parser-for-resolved-expressions

Conversation

@narsaynorath
Copy link
Copy Markdown
Member

@narsaynorath narsaynorath commented Apr 16, 2026

Adds a parser helper that will take a resolved equation, and break out the smaller sub-components needed to compose the original equation.

This gets around the issue of alerts only storing the single aggregate it's alerting on. In the equation case it'll be the full equation, so for the UI to continue using references we need to parse the equation and get the subcomponents to initialize some local state.

You don't really need to review the MetricsEquationVisualize, I just wanted to add it to mock out a spot where I think the new UI we're building for equations will live. It mostly just validates the idea of parsing an equation from something I've saved here: https://sentry.dev.getsentry.net:7999/monitors/7037172/edit/ . It also prevents knip from complaining without having to add a line to ignore knip for this helper

Screenshot 2026-04-16 at 4 37 54 PM

You can also test it here: https://sentry-gx0w9jqhi.sentry.dev/monitors/7037172/edit/
and enable the tracemetrics-equations-in-alerts flag

@narsaynorath narsaynorath requested review from a team as code owners April 16, 2026 20:56
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 16, 2026
@narsaynorath narsaynorath force-pushed the nar/feat/tracemetrics-alert-equations-add-parser-for-resolved-expressions branch from 51da647 to f75409d Compare April 16, 2026 20:58
@narsaynorath narsaynorath requested review from a team as code owners April 16, 2026 20:58
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@narsaynorath narsaynorath marked this pull request as draft April 16, 2026 20:58
@narsaynorath narsaynorath changed the base branch from nar/ref/tracemetrics-equations-extract-state-keeping-from-state-changes to master April 16, 2026 20:58
@narsaynorath narsaynorath removed request for a team April 16, 2026 20:59
@narsaynorath narsaynorath removed request for a team April 16, 2026 20:59
@narsaynorath narsaynorath marked this pull request as ready for review April 16, 2026 21:00
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.

Knip 🤛

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 Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants