-
Notifications
You must be signed in to change notification settings - Fork 31
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
Initial webvitals integration #25
Conversation
src/webvitals.js
Outdated
export function initWebVitals(provider) { | ||
const tracer = provider.getTracer('webvitals'); | ||
// CLS is defined as being sent more than once, easier to just ensure that everything is sent just on the first occurence. | ||
const reported = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can make this var local to this file, because webvitals should be initiated at most once per page
const value = metric.value; | ||
const span = tracer.startSpan('webvitals'); | ||
span.setAttribute(name, value); | ||
span.end(span.startTime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have we confirmed this with Justin? or are we deciding now it's going to be sent like that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent point. I'll post on the team channel and seek some input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to approve this, but now I'm not sure, I can't seem to find any conclusions in that Slack thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read it as "looks good enough" but we can wait another day or two for any more objections/discussion to pop up.
Initial webvitals integration
No description provided.