aws-observability / aws-rum-web

Amazon CloudWatch RUM Web Client
Apache License 2.0
114 stars 65 forks source link

feat: add attributions for core web vitals: LCP, CLS, and FID #432

Closed williazz closed 10 months ago

williazz commented 10 months ago

Revision 1

  1. Collect attributions for LCP, FID, and CLS
  2. Only some fields are captured, ignoring those that are redundant or not relevant for diagnostics

Revision 2

Will be included in another PR

  1. Link CWV attributes to their related Resource and Navigation events
  2. Integ test for FID, if possible

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

qhanam commented 10 months ago

issue: I think we should create browser integ tests for web vital attribution, especially considering different browsers support different features related to the collection of web vitals.

williazz commented 10 months ago

issue: I think we should create browser integ tests for web vital attribution, especially considering different browsers support different features related to the collection of web vitals.

Currently looking into this. If the scope is big enough, it may have to be a separate PR @qhanam

Update:

Added integ test for attribution for LCP and CLS on chrome. FID is supported on Chrome, Firefox (and Safari + IE via polyfill). However, FID cannot be tested on testcafe because the web vitals package knows to ignore manually triggered user input.

https://github.com/GoogleChrome/web-vitals#browser-support