Speed Insights Drains Reference

Speed Insights Drains send performance metrics and web vitals from your applications to external endpoints for storage and analysis. To enable Speed Insights Drains, create a drain and choose the Speed Insights data type.

Vercel sends Speed Insights data to endpoint URLs over HTTPS when your application collects performance metrics.

The following table describes the possible fields that are sent via Speed Insights Drains:

NameTypeDescriptionExample
schemastringSchema version identifiervercel.speed_insights.v1
timestampstringISO timestamp when the metric was collected2023-09-14T15:30:00.000Z
projectIdstringIdentifier for the Vercel projectQmc52npNy86S8VV4Mt8a8dP1LEkRNbgosW3pBCQytkcgf2
ownerIdstringIdentifier for the project ownerteam_nLlpyC6REAqxydlFKbrMDlud
deviceIdnumberUnique device identifier12345
metricTypestringType of performance metricCLS, LCP, FID, FCP, TTFB, INP
valuenumberMetric value0.1
originstringOrigin URL where the metric was collectedhttps://example.com
pathstringURL path where the metric was collected/dashboard
routestringRoute pattern for the page/dashboard/[id]
countrystringCountry code of the userUS
regionstringRegion code of the userCA
citystringCity of the userSan Francisco
osNamestringOperating system namemacOS
osVersionstringOperating system version13.4
clientNamestringClient browser nameChrome
clientTypestringType of clientbrowser
clientVersionstringClient browser version114.0.5735.90
deviceTypestringType of devicedesktop
deviceBrandstringDevice brandApple
connectionSpeedstringNetwork connection speed4g
browserEnginestringBrowser engine nameBlink
browserEngineVersionstringBrowser engine version114.0.5735.90
scriptVersionstringSpeed Insights script version1.0.0
sdkVersionstringSDK version used to collect metrics2.1.0
sdkNamestringSDK name used to collect metrics@vercel/speed-insights
vercelEnvironmentstringVercel environmentproduction
vercelUrlstringVercel deployment URL*.vercel.app
deploymentIdstringIdentifier for the Vercel deploymentdpl_2YZzo1cJAjijSf1hwDFK5ayu2Pid
attributionstringAttribution information for the metricattribution-data

Vercel supports the following formats for Speed Insights Drains. You can configure the format when configuring the Drain destination:

Vercel sends Speed Insights data as JSON arrays containing metric objects:

[
  { "schema": "vercel.speed_insights.v1", "timestamp": "2023-09-14T15:30:00.000Z", "projectId": "Qmc52npNy86S8VV4Mt8a8dP1LEkRNbgosW3pBCQytkcgf2", "ownerId": "team_nLlpyC6REAqxydlFKbrMDlud", "deviceId": 12345, "metricType": "CLS", "value": 0.1, "origin": "https://example.com", "path": "/dashboard" },
  { "schema": "vercel.speed_insights.v1", "timestamp": "2023-09-14T15:30:05.000Z", "projectId": "Qmc52npNy86S8VV4Mt8a8dP1LEkRNbgosW3pBCQytkcgf2", "ownerId": "team_nLlpyC6REAqxydlFKbrMDlud", "deviceId": 67890, "metricType": "LCP", "value": 2.5, "origin": "https://example.com", "path": "/home" }
]

Vercel sends Speed Insights data as newline-delimited JSON objects:

{"schema": "vercel.speed_insights.v1","timestamp": "2023-09-14T15:30:00.000Z","projectId": "Qmc52npNy86S8VV4Mt8a8dP1LEkRNbgosW3pBCQytkcgf2","ownerId": "team_nLlpyC6REAqxydlFKbrMDlud","deviceId": 12345,"metricType": "CLS","value": 0.1,"origin": "https://example.com","path": "/dashboard"}
{"schema": "vercel.speed_insights.v1","timestamp": "2023-09-14T15:30:05.000Z","projectId": "Qmc52npNy86S8VV4Mt8a8dP1LEkRNbgosW3pBCQytkcgf2","ownerId": "team_nLlpyC6REAqxydlFKbrMDlud","deviceId": 67890,"metricType": "LCP","value": 2.5,"origin": "https://example.com","path": "/home"}

When you configure a Speed Insights Drain in the Vercel UI, you can set the sampling rate to control the volume of data sent. This helps manage costs when you have high traffic volumes.

For more information on Speed Insights Drains and how to use them, check out the following resources: