-
Notifications
You must be signed in to change notification settings - Fork 415
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
Support for Server-Timing
#302
Comments
Did you have a specific API design idea in mind? Right now it's pretty easy to get server timing data in either the standard or attribution build: onTTFB((metric) => {
console.log(metric.entries[0]?.serverTiming);
}); Given that server timing info so site-specific, I'm not sure if we need more sugar on top of what we already have? |
I think a bit of sugar could make this a bit more approachable, IMO: onTTFB((metric) => {
// Server-Timing entries for the navigation request:
console.log(metric?.serverTiming);
}); |
Adding the Seems inline with how the other metrics were handled for #203 |
If you're using the attribution build, you can get the server timing value like this: onTTFB((metric) => {
console.log(metric.attribution.navigationEntry?.serverTiming);
}); Which isn't much different from @malchata's example: + console.log(metric.attribution.serverTiming);
- console.log(metric.attribution.navigationEntry?.serverTiming); Every other property of each attribution object is a calculation of some sort, so it feels a bit arbitrary to add sugar for this one and not others. And if we add it for others then we're increasing code size quite a bit for values that most people aren't using. |
Think I'm with @philipwalton now. But let's document this as an example to make it more obvious how to access. Opened #324 for that. |
If a document includes
Server-Timing
headers, it could be useful to report that as TTFB diagnostic data in the RUM beacon. Is there anything this library can do to better support this kind of data?This is a follow up to #203 by @malchata which originally proposed tracking
Server-Timing
, but AFAICT it wasn't ultimately added to the attribution build. Is there any additional context behind that decision, or worth reevaluating?The text was updated successfully, but these errors were encountered: