Skip to content
Telemetry
Frontend reliability SQL recipe

Compare Core Web Vitals by route and release

Compare LCP, INP, and CLS samples by stable route and release while keeping the percentage of passing samples visible.

Intermediatefrontend_vital_eventsReviewed 2026-07-28Tested with Apache DataFusion 45.2.0

Reviewed by the Telemetry product team on . We checked the SQL syntax, required event fields, sample results, and limits on using the query. Who reviews this page

Question answered

Which route and release has the weakest frontend performance?

Compare frontend performance by route and release to find regressions. This query produces one row per group and sorts by the share of Web Vital samples that passed your thresholds.

Event schema

Fields the query expects

FieldTypeWhy it exists
timestamp_utcTimestampMeasurement time in UTC.
route_templateUtf8Stable route template without user or query-string values.
releaseUtf8Frontend release identifier.
metric_nameUtf8Controlled LCP, INP, or CLS metric name.
metric_valueFloat64Metric value in its documented unit.
passedBooleanWhether the sample passed the product's versioned threshold.
environmentUtf8Deployment environment.
DataFusion SQL

Copy the query

sql
SELECT
  route_template,
  release,
  COUNT(*) AS samples,
  AVG(CASE WHEN metric_name = 'LCP' THEN metric_value ELSE NULL END) AS avg_lcp_ms,
  AVG(CASE WHEN metric_name = 'INP' THEN metric_value ELSE NULL END) AS avg_inp_ms,
  AVG(CASE WHEN metric_name = 'CLS' THEN metric_value ELSE NULL END) AS avg_cls,
  100.0 * SUM(CASE WHEN passed THEN 1 ELSE 0 END)
    / NULLIF(COUNT(*), 0) AS passing_samples_pct
FROM frontend_vital_events
WHERE timestamp_utc >= now() - INTERVAL '7 days'
  AND environment = 'production'
GROUP BY route_template, release
ORDER BY passing_samples_pct ASC, route_template, release;

This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. We review the synthetic sample output separately. Check field types, thresholds, and counting rules against your own data. Read the testing methodology.

Query result

Passing frontend samples by route

Checkout passes half of its synthetic LCP, INP, and CLS samples; search passes all samples.

route_templatereleasesamplesavg_lcp_msavg_inp_msavg_clspassing_samples_pct
/checkoutweb-10262,8002200.150
/searchweb-10261,8501200.05100

Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.

Passing frontend samples by route: static chart of synthetic passing_samples_pct values from the Compare Core Web Vitals by route and release example result
Download this SVG chart of the sample results for an article, runbook, or design review. Please credit Telemetry.

Reproduce the example

Download the sample data

The JSON bundle includes the event schema with field types, reproducible input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.

How the SQL works

  1. 1Route templates prevent one chart series per raw URL or customer identifier.
  2. 2The release dimension turns a performance change into a deploy-scoped investigation.
  3. 3Metric-specific averages remain beside a single passing-sample summary so reviewers can see which vital moved.

Edge cases to check

  • Use reviewed metric-specific thresholds and record their version when definitions change.
  • Compare device classes and regions only when each group has enough samples to interpret its percentiles.
  • Prefer percentiles over averages for production experience reporting when the SQL engine and sample volume permit it.

Recommended dashboard

  • Bars: passing_samples_pct by route and release
  • Trends: LCP, INP, and CLS by complete day
  • Table: routes with sample count and release change

Alert guidance

Alert only when sample volume is sufficient and a route remains below its reviewed performance target for complete buckets.

Read alert setup

Set up the events this query needs

Related instrumentation and guides

Define the source data

Event schemas for this analysis

Continue the analysis

Run it on your events

Create a table, adapt the fields, and save the result

Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.

Get an API key