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

Config option or custom hooks for additional Facets on RUM Resources #482

Closed
robolmos opened this issue Aug 12, 2020 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@robolmos
Copy link

This probably isn't possible due to RUM only using the Performance API, but I'll throw out there as a future idea:

I'd like to add additional facets to individual Resource calls to help with analyzing the data.

The main facet I have in mind would be the CDN's cache result being hit or miss, which is an HTTP response header. Being able to include any CDN IDs would be nice.

The CDNs are a caching proxy style (eg, Cloudflare, CloudFront, StackPath, etc.) that use the same origin/domain as the website, so there shouldn't be an issue with accessing the response headers.

Cloudflare and CloudFront have a simple CF-Cache-Status or X-Cache response header and hit/miss value, but other services like StackPath have a more complicated header value, eg, "1541178655.cds005.da2.hc,1541178655.cds113.da2.c" so would need custom parsing.

@bcaudan
Copy link
Contributor

bcaudan commented Aug 24, 2020

Hi @robolmos,

Nice suggestion but to retrieve resource data, we are using:

  1. resource timing API, which does not provide access to response headers

  2. js proxy for XHR and fetch requests, which would not be the most relevant resources for CDN cache data

Did you have an approach in mind?

@bcaudan bcaudan added the enhancement New feature or request label Oct 30, 2020
@BenoitZugmeyer
Copy link
Member

Hello, sorry for the late follow up :)

We released a new API in v2.13.0 to allow adding additional data on events, based on a "context" used to generate the event. So, you now have access to the performanceEntry exposed by the browser for each resource event, and the possibility to use those to extend the event.context property to store additional data.

But, like @bcaudan wrote, the browser does not expose the headers of resources, even if they are served on the same origin. I don't think we can do much more for your use case, sorry!

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

3 participants