Skip to content

feat(discover): Allow ttid/ttfd contribution rate in arithmetic equations#109521

Merged
gggritso merged 1 commit intomasterfrom
georgegritsouk/dain-1243-backend
Feb 27, 2026
Merged

feat(discover): Allow ttid/ttfd contribution rate in arithmetic equations#109521
gggritso merged 1 commit intomasterfrom
georgegritsouk/dain-1243-backend

Conversation

@gggritso
Copy link
Member

Add ttid_contribution_rate and ttfd_contribution_rate to the allowed arithmetic functions list in ArithmeticVisitor. This is needed so the Mobile Vitals dashboard can use these functions with the equation| prefix in widget aggregates.

Without this, any equation containing these functions would fail backend validation, causing the Span Operations table widget to break when the equation| prefix is applied (see companion frontend PR).

Follows the same pattern as #107958 (which added tpm, conditional _if functions for the Frontend Overview dashboard).

Refs DAIN-1243

…ions

Add `ttid_contribution_rate` and `ttfd_contribution_rate` to the
allowed arithmetic functions in discover equations. The Mobile Vitals
dashboard uses these functions in widget equations, and without them
being in the allowed list, equation validation would fail.

Refs DAIN-1243
Co-Authored-By: Claude <noreply@anthropic.com>
@linear
Copy link

linear bot commented Feb 26, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 26, 2026
@gggritso gggritso requested a review from a team February 26, 2026 21:08
@gggritso gggritso marked this pull request as ready for review February 27, 2026 14:13
@gggritso gggritso requested a review from a team as a code owner February 27, 2026 14:13
@gggritso gggritso merged commit b8493f5 into master Feb 27, 2026
69 checks passed
@gggritso gggritso deleted the georgegritsouk/dain-1243-backend branch February 27, 2026 14:22
gggritso added a commit that referenced this pull request Feb 27, 2026
…in Mobile Vitals (#109525)

The Span Operations table in the Mobile Vitals dashboard uses
`ttid_contribution_rate()` and `ttfd_contribution_rate()` as aggregates.
When clicking "Open in Explore", these were silently dropped because
`getWidgetExploreUrl` filters aggregates to only those present in
`eventView.getYAxisOptions()` — which only recognizes functions known
natively to Explore.

Prefixing with `equation|` fixes this: equations pass the
`isAggregateEquation()` check in `getYAxisOptions()`, so they're
included in the yAxis options and flow through to Explore correctly. The
functions are defined in EAP
(`src/sentry/search/eap/spans/formulas.py`), so Explore can resolve
them.

The backend companion PR (#109521) adds these functions to the
arithmetic allowed list so they pass equation validation.

Follows the same pattern as #108045 (Frontend Overview dashboard).

**Note:** This PR depends on #109521 landing first.

Fixes DAIN-1243

Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants