Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Backfill HttpEvents from cached PerformanceResourceTiming with initiator types Fetch, Xhr, and Beacon #580

Open
williazz opened this issue Aug 22, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@williazz
Copy link
Contributor

Please provide your feature request

RUM can records HTTP requests in two formats:

  1. As an HTTP event with status codes and nested objects for request/response
  2. As a ResourceEvent, which includes full latency breakdown. But no status code or nested object for request/response

There is a gap in RUM's capabilities, however, because (2) can be recorded from the PerformanceAPI cache even if RUM is initialized much later. But (1) can only be recorded at runtime. Instead, RUM should backfill cached PerformanceResourceTiming entries into HttpEvents when HTTP Requests are sent by Fetch, Xhr, and Beacon.

The reason we should do this is because

  1. PerformanceResourceTiming.responseStatus has received broader browser support and should be used in production wherever possible. https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/responseStatus
  2. Prevent data loss

[Optional] Nice to haves to complete the story

  1. There should be a way to link the ResourceEvent and HttpEvents for the same HTTP requests
  2. There should be a way to observe all beacon requests
@williazz williazz added the enhancement New feature or request label Aug 22, 2024
@williazz
Copy link
Contributor Author

[Optional]

  1. Add responseStatus to ResourceEvent schema, since it is no longer an experimental feature.

@sonu-gameskraft
Copy link

Core functionality of RUM for SSR website is not working to capture http error.

  1. Upgraded the RUM version from 1.18.0 to 1.19.0
  2. I would like to clarify that the Performance API focuses on performance-related metrics, which don't meet my request. I only want to track HTTP and error metrics. But still, I tried implementing the script you suggested for the Performance API, but unable to catch the 403 error.
  3. I've increased the priority of the cwr.js file, so now it's loaded before the generated JS file. However, we are still experiencing issues with session and not catching HTTP errors.
  4. performance telemetry also not able to capture 4xx and 5XX error
Screenshot 2024-08-22 at 2 38 52 PM Screenshot 2024-08-22 at 2 38 52 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants