Skip to content

feat(dashboards): Add trace metrics variants of the web vitals dashboards - #128924

Merged
edwardgou-sentry merged 27 commits into
masterfrom
edwardgou-sentry/feat/dashboards-web-vitals-trace-metrics-config
Nov 2, 2026
Merged

edwardgou-sentry merged 27 commits into
masterfrom
edwardgou-sentry/feat/dashboards-web-vitals-trace-metrics-config

Conversation

@edwardgou-sentry

@edwardgou-sentry edwardgou-sentry commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds a trace metrics version of the Web Vitals prebuilt dashboards. These dashboards are meant to replicate the functionality of the existing spans backed Web Vitals dashboards, but with trace metrics data. This is a work in progress and some of the widgets defined here still remain on spans while we work on unblocking in metrics.

This version is behind feature flag and won't be shown to users yet.

Scores come from browser.web_vital.<vital>.score ratio metrics emitted from Relay.

Leverages FractionUnit for the score metrics from the stacked pr (#129337).

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 27, 2026
@sentry

sentry Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 780 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 95.86% 95.86% ±0%
Typed 142,703 142,755 🟢 +52
Untyped 6,162 6,165 🔴 +3
🔍 3 new type safety issues introduced

Non-null assertions (!) (2 new)

File Line Detail
static/app/views/dashboards/datasetConfig/utils/traceMetricsResponseTransforms.ts 70 widget.queries[queryIndex]!
static/app/views/dashboards/utils/prebuiltConfigs/webVitals/traceMetrics/webVitals.ts 21 WEB_VITALS_PREBUILT_CONFIG.widgets.find( widget => widget.id === 'pages-table' …

Type assertions (as) (1 new)

File Line Detail
static/app/views/dashboards/utils/webVitalTraceMetricFields.ts 73 as Partial<Record<WebVitals, number>> — Object.fromEntries( vitalsWithData.map(vital => [vital, Number(row[webVitalScor…

This is informational only and does not block the PR.

@linear-code

linear-code Bot commented Oct 27, 2026

Copy link
Copy Markdown

ENG-8907

…ware helper

Lets a prebuilt config be swapped for a variant behind an org feature without touching every consumer.
…ards

Served behind dashboards-web-vitals-trace-metrics. Samples and interactions stay on spans.
… of score formulas

The trace metrics dataset has no performance_score or count_scores, so use avg and count. The pages table stays on spans.
@edwardgou-sentry
edwardgou-sentry force-pushed the edwardgou-sentry/feat/dashboards-web-vitals-trace-metrics-config branch from ebd2c3e to 3aaea66 Compare October 28, 2026 19:35
Drop the series label rework and extra tests the variants do not need.
Base automatically changed from edwardgou-sentry/feat/dashboards-prebuilt-config-resolver to master October 28, 2026 20:12
…ards

Served behind dashboards-web-vitals-trace-metrics. Samples and interactions stay on spans.
… of score formulas

The trace metrics dataset has no performance_score or count_scores, so use avg and count. The pages table stays on spans.
Drop the series label rework and extra tests the variants do not need.
@edwardgou-sentry
edwardgou-sentry force-pushed the edwardgou-sentry/feat/dashboards-web-vitals-trace-metrics-config branch from 2466842 to c397de8 Compare October 28, 2026 20:12
…try/feat/dashboards-web-vitals-trace-metrics-config
Drops the local unit widening now that DataUnit knows about fractions.
@edwardgou-sentry
edwardgou-sentry removed this pull request from stack #129080 October 30, 2026 22:09
@edwardgou-sentry
edwardgou-sentry changed the base branch from master to edwardgou-sentry/feat/fraction-unit October 30, 2026 22:09
const isScoreBreakdown = isWebVitalScoreBreakdownChart(widget.queries[queryIndex]!);
return transformTimeSeriesResponse(
isScoreBreakdown
? transformPerformanceScoreBreakdownTimeSeries(data, webVitalScoreField)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This logic is copied over from the spans version path.

Applies a weight to each web vital score series. The end result is that the "area" of all the series together form the total score (maxed out at 100).

…ics dashboards

Matches the spans dashboards. It fills in once Relay copies geo attributes onto the metrics.
import {ModuleName} from 'sentry/views/insights/types';

// TODO: Move these to trace metrics once the metrics can back them.
const SPANS_WIDGET_IDS = new Set([

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TODO: several charts still use the spans dataset for now until attributes are more complete on metrics and necessary score functions are added to metrics dataset. Those blockers are being worked on in parallel.

@edwardgou-sentry

Copy link
Copy Markdown
Contributor Author

@cursor review

@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 2 potential issues.

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 9f1f71c. Configure here.

@edwardgou-sentry
edwardgou-sentry marked this pull request as ready for review October 31, 2026 00:03
@edwardgou-sentry
edwardgou-sentry requested a review from a team as a code owner October 31, 2026 00:03
Base automatically changed from edwardgou-sentry/feat/fraction-unit to master November 2, 2026 16:41
@edwardgou-sentry
edwardgou-sentry requested review from a team as code owners November 2, 2026 16:41
…entry/feat/dashboards-web-vitals-trace-metrics-config

# Conflicts:
#	static/app/views/dashboards/datasetConfig/utils/traceMetricsResponseTransforms.ts
@edwardgou-sentry
edwardgou-sentry merged commit ae5b6d2 into master Nov 2, 2026
84 checks passed
@edwardgou-sentry
edwardgou-sentry deleted the edwardgou-sentry/feat/dashboards-web-vitals-trace-metrics-config branch November 2, 2026 17:10

This branch was successfully deployed

1 active deployment
Preview — 09d7d3d2 Deployed Nov 2, 2026 by vercel[bot]
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.

2 participants