Collect RUM data with Fastly Compute@Edge
This service is used to collect RUM (Real User Monitoring) Data, specifically Core Web Vitals snapshots, for Helix websites. It is deployed to Fastly's Compute@Edge edge computing service and will store the collected data using Fastly's real-time log forwarding in Coralogix and Google BigQuery for further analysis.
$ curl -X POST https://rum.hlx3.page/.rum/1 -d '{"cwv":{ "CLS": 1.0, "LCP": 1.0, "FID": 4 }, "id": "blablub", "weight": 2}' X-Forwarded-Host:example.com
The payload of a typical request looks like this:
{
"id": "-1617507985-1629963441842-d6998c875b962",
"weight": 100,
"generation": "test-optimize-fonts",
"referrer": "https://example.com/index.html",
"cwv": {
"CLS": 0.0097652112,
"LCP": 800.7,
"FID": 10.8999999762,
}
}
id
: this is a generated request ID. Format does not matter, but it is important that this ID stays the same for a given page view.weight
: the inverse of the sampling frequency used when tracking RUM data. In a typical site, only every100
th request will be sampled, so the weight is100
.generation
: (optional) if you are trying different variants of the same website and want to evaluate the impact of code changes, add ageneration
field which could be the name of the feature branch or feature flag or just a description of the significant changecheckpoint
: (optional) if you want to track the drop-off of traffic as part of the load process, you can send events with an emptycwv
object and the name of the checkpoint.referrer
/referer
: (optional) when using Helix RUM Collector as a third-party service, browsers will truncate theReferer
HTTP header. This optional field allows to pass it explicitly. Both spellings are allowed.cwv
: contains the Core Web Vitals data payload. Typically these measurements trickle in over the course of the page rendering, and are posted as soon as they are available, so a given request will have only one data point. Thanks to the stableid
they can be merged for analysis.cwv/CLS
: Cumulative Layout Shiftcwv/LCP
: Largest Contentful Paint in millisecondscwv/FID
: First Input Delay in milliseconds
POST
User-Agent
X-Forwarded-Host
Referer