Skip to content

feat(dashboards): Add performance_score and opportunity_score to Explore - #112146

Merged
DominikB2014 merged 9 commits into
masterfrom
dominikbuszowiecki/dain-1451-update-prebuilt-score-labels-and-explore-dropdown
Apr 14, 2026
Merged

DominikB2014 merged 9 commits into
masterfrom
dominikbuszowiecki/dain-1451-update-prebuilt-score-labels-and-explore-dropdown

Conversation

@DominikB2014

@DominikB2014 DominikB2014 commented Apr 2, 2026 •

Copy link
Copy Markdown
Contributor

Remove the equation| prefix from performance_score and opportunity_score in prebuilt dashboard configs and register them as first-class aggregation functions in the Explore view. This makes "Open in Explore" from dashboards work correctly for widgets using these functions.

Dashboards

image

Explore

image

Monitors

image

Changes:

  • Add opportunity_score to AggregationKey enum and AGGREGATION_FIELDS / AGGREGATIONS
  • Add both performance_score and opportunity_score to ALLOWED_EXPLORE_VISUALIZE_AGGREGATES (placed at the bottom)
  • Restrict both functions' column parameters to only valid measurements.score.* fields via validateAllowedColumns
  • Strip the equation| prefix from all prebuilt dashboard configs (webVitals, pageDetails, frontendOverview, nextJsOverview)
  • Add 'score' to isLegalYAxisType so these functions aren't filtered out of Y-axis options
  • Handle column restriction validation in updateVisualizeAggregate and useVisualizeFields so Explore respects the allowed values when selecting or switching to these functions

Refs DAIN-1451

@linear-code

linear-code Bot commented Apr 2, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 2, 2026
… and Explore

Use dropdown parameter definitions from AGGREGATIONS for performance_score
and opportunity_score in EAP_AGGREGATIONS, so the widget builder correctly
restricts column selection to measurements.score.* fields. Also adds the
dropdown check before the SPANS/LOGS early return in getColumnOptions, and
narrows the Explore visualize field filter to only these two functions.

Refs DAIN-1451
Co-Authored-By: Claude Opus 4.6 <[email protected]>
DominikB2014 and others added 2 commits April 8, 2026 10:28
Scope the argument validation in updateVisualizeAggregate to only
performance_score and opportunity_score, matching the narrowing already
done in useVisualizeFields. Avoids applying the function-type columnTypes
check to unrelated aggregates like avg, sum, p50-p100.

Refs DAIN-1451
Co-Authored-By: Claude Opus 4.6 <[email protected]>
…nique

When switching from count_unique or no-argument aggregates to
performance_score or opportunity_score, use the function's own
defaultValue (measurements.score.total) instead of the generic
DEFAULT_VISUALIZATION_FIELD (span.duration).

Refs DAIN-1451
Co-Authored-By: Claude Opus 4.6 <[email protected]>
The dropdown kind check was accidentally removed from the non-SPANS/LOGS
code path in getColumnOptions. Restore it so that functions with dropdown
parameters (like count_if conditions) continue to work on Errors and
Transactions datasets.

Refs DAIN-1451
Co-Authored-By: Claude Opus 4.6 <[email protected]>
DominikB2014 and others added 2 commits April 9, 2026 14:15
When switching from aggregates with empty arguments (e.g., count()) to
performance_score or opportunity_score, the oldArguments?.length check
was falsy for empty arrays, skipping the score validation and producing
an invalid function call with missing required arguments. Restructure
the check to handle score functions first, falling back to defaults
when no old arguments exist.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

@cursor cursor Bot left a comment

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.

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 a09219e. Configure here.

@DominikB2014
DominikB2014 marked this pull request as ready for review April 13, 2026 16:54
@DominikB2014
DominikB2014 requested review from a team as code owners April 13, 2026 16:54

@nsdeschenes nsdeschenes left a comment

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.

All looks good to me 👍

@DominikB2014
DominikB2014 merged commit c8774ef into master Apr 14, 2026
65 checks passed
@DominikB2014
DominikB2014 deleted the dominikbuszowiecki/dain-1451-update-prebuilt-score-labels-and-explore-dropdown branch April 14, 2026 14:35
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026

This branch was successfully deployed

1 active deployment
Preview — de023ee7 Deployed Apr 9, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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