aws-observability / aws-rum-web

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

fix: Record resource timing after load event #450

Closed qhanam closed 9 months ago

qhanam commented 9 months ago

The web client does not currently record PerformanceResource entries after the load event fires. This means that slow, asynchronous resources, that contribute to poor web vitals like LCP or CLS, will not be recorded.

This change modifies the PerformanceResource plugin to continue listening to PerformanceResource entries after the load event.

To accomplish this, we modify our resource prioritization in the following ways:

  1. We always record entries for document, scripts, stylesheets and fonts (was previously capped).
  2. We record entries for everything else (including images) up to the configured limit.

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

williazz commented 9 months ago

I agree with the implementation. Only blocking thing for me to understand how you fixed that resource plugin integration test