grafana / faro-web-sdk

The Grafana Faro Web SDK, part of the Grafana Faro project, is a highly configurable web SDK for real user monitoring (RUM) that instruments browser frontend applications to capture observability signals. Frontend telemetry can then be correlated with backend and infrastructure data for full-stack observability.
https://grafana.com/oss/faro/
Apache License 2.0
739 stars 64 forks source link

Add web vitals with attribution instrumentation #595

Closed vitebo closed 3 months ago

vitebo commented 4 months ago

Why

This is a feature that will be useful as discussed in this issue https://github.com/grafana/faro-web-sdk/issues/593

What

Links

https://github.com/grafana/faro-web-sdk/issues/593

Checklist

CLAassistant commented 4 months ago

CLA assistant check
All committers have signed the CLA.

CLAassistant commented 4 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

codecapitano commented 3 months ago

There are some linter issues. You can find/fix them by running yarn prettier --write .

vitebo commented 3 months ago

I now realized that the PR's commit history has become huge, if needed I can clean up this timeline before the merge, just let me know

codecapitano commented 3 months ago

I now realized that the PR's commit history has become huge, if needed I can clean up this timeline before the merge, just let me know

No need to clean up. It's just part of the PR and a good documentation about the thoughts behind and the progress as well

codecapitano commented 3 months ago

@vitebo did you already sign the Contributor License Agreement?

vitebo commented 3 months ago

@vitebo did you already https://github.com/grafana/faro-web-sdk/pull/595#issuecomment-2118994584?

oops, that was missing. I signed now

vitebo commented 3 months ago

I can even see now on drone.grafana.net (apparently I couldn't access it before) that some lint rules are breaking, I'll fix it here

vitebo commented 3 months ago

@codecapitano I did the sync here because apparently it was the only check that was missing, but you will probably need to release the CI again https://github.com/grafana/faro-web-sdk/pull/595/commits/626c6a73b40f82f65d05c4f0b6fce19e26dfe105

vitebo commented 3 months ago

Great! I've made the change here: https://github.com/grafana/faro-web-sdk/pull/595/commits/ef356bc9710255117c5e832c2592b3be7cd3eaaf

One thing that bothers me is that the option is called trackWebVitalAttribution instead of trackWebVitalsAttribution, as suggested here: https://github.com/grafana/faro-web-sdk/pull/595#discussion_r1615898424

This creates an inconsistency in the codebase, with it being referred to as webVital in some places and webVitals in others. Looking at the Google Chrome repo, they always use webVitals.

@codecapitano do you see any problem with standardizing it here as well? I can make this change today if it makes sense

codecapitano commented 3 months ago

Great! I've made the change here: ef356bc

One thing that bothers me is that the option is called trackWebVitalAttribution instead of trackWebVitalsAttribution, as suggested here: #595 (comment)

This creates an inconsistency in the codebase, with it being referred to as webVital in some places and webVitals in others. Looking at the Google Chrome repo, they always use webVitals.

@codecapitano do you see any problem with standardizing it here as well? I can make this change today if it makes sense

Hey @vitebo yes please rename it! When I wrote the suggestion for the name it was a typo that the "s" was missing. Great catch!

codecapitano commented 3 months ago

Approved @vitebo thank you so much and congrats to your first Faro contribution. 🥳 Great work!