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

Negative timing on documentParsingTime #556

Closed
jcarres-mdsol opened this issue Apr 13, 2024 · 14 comments
Closed

Negative timing on documentParsingTime #556

jcarres-mdsol opened this issue Apr 13, 2024 · 14 comments
Labels
bug Report a bug

Comments

@jcarres-mdsol
Copy link

Description

documentParsingTime is always a big negative time.

Example of a navigation event:
Screenshot 2024-04-12 at 11 06 28 PM

In the above example the TTFB was 472, FCP 1807 and lcp 1977

Also I do not think numbers quite add up but I am just not understanding this well.

I would imagine FCP = TTFB + pageLoadTime but it is never quite that. Maybe my understanding is wong?
Also, does the navigation event has a time for LCP - FCP ? Or the point of providing those is to not need it to be in the navigation event?

Environment

  • OS:
    Mac OS 14.1.1
  • Browser:
    Firefox 125.0beta9

Faro 1.5.1
Web SDK, Web Tracing, React
Desktop

@jcarres-mdsol jcarres-mdsol added the bug Report a bug label Apr 13, 2024
@codecapitano
Copy link
Collaborator

codecapitano commented Apr 15, 2024

Hi @jcarres-mdsol

documentParsingTime is always a big negative time.

This should not happen.
Would you mind to provide a bit more context here to make debugging the issue easier?
E. g. does it happen for all browsers or a specific browser+version?

In the above example the TTFB was 472, FCP 1807 and lcp 1977
Also I do not think numbers quite add up but I am just not understanding this

That's correct.

The web vitals represents loading and rendering milestones and not all are in direct relation to the contents of a resource entry.
Take LCP as an example which is the time it takes to load and render the largest visible element on a page. The browser use as set of rules to define what element qualifies as the LCP element to calculate the time for.

The page load time is the time between the browser starts fetching a resource (fetchStart) and when the document and all sub-resources have finished loading (domComplete).

Between the largest contentful paint and the domComplete other things happen so you can not simply sum up the web vitals to get the page load time.

Also, does the navigation event has a time for LCP - FCP ? Or the point of providing those is to not need it to be in the navigation event?

No, navigation timings do not contain web-vitals.
Faro has a dedicated instrumentation to send web-vitals.
You need to do the calculation either in your o11y tool or you can use Faro's beforeSend hook to enrich beacons with custom data

Or the point of providing those is to not need it to be in the navigation event?

They are not related to the data the navigation entry.
It's a set of load and rendering performance milestones to judge the related UX of a web site or app.

Cheers,
Marco

@codecapitano
Copy link
Collaborator

Note:
Just double checked the negative parsing time.
Looks like there's something different with firefox dev edition/beta.

Tested with following browsers:

  • Chrome 123.0.6312.123 - works ✅

  • Firefox 124.0.2 - works ✅

  • Safari - works ✅

  • Firefox Dev Edition 125.0b9 - does not work ❌

@jcarres-mdsol
Copy link
Author

Sorry, you got there faster than me.

I've tried in addition Firefox 125b9 and it works.

So ironically Firefox normal edition works but developer edition does not.

@codecapitano
Copy link
Collaborator

codecapitano commented Apr 16, 2024

Hey @jcarres-mdsol thanks a lot that you also had a look.
It's always great to see people care and invest time to report issues or help with debugging.
Very appreciated!

Let's wait and see if it gets fixed. I double checked the MDN docs if there are changes which affect the APIs we are using but couldn't find anything.

Cheers,
Marco

@codecapitano
Copy link
Collaborator

codecapitano commented Apr 16, 2024

@jcarres-mdsol may I ask from what tool you've taken the screenshot above?

@jcarres-mdsol
Copy link
Author

Grafana/Loki
That's simply the result of searching for

{service="...."}  | json 

Then opening a faro.performance.navigation log message

@codecapitano
Copy link
Collaborator

codecapitano commented Apr 16, 2024

Ah ok, I wondered why it looks so different to the original log format.

{app_id="..."} |~ "faro.performance.navigation" | logfmt

Screenshot 2024-04-16 at 17 07 20

@codecapitano
Copy link
Collaborator

@jcarres-mdsol
Copy link
Author

Oh, interesting, you are saying our text format in the log is different.
Yeah, we are coming from a different vendor. This other vendor almost but not quite implemented opentelemetry, doing something very weird in their output. So we added a proxy that "fixes" their format to be normal otel before hitting our otel collector.
As this is an experiment, I just pointed faro instrumentation to the same collector, probably the "fixing" proxy is doing this.
As we substitute them out, we will drop the hack.

Faro is way better, I really appreciate your work here

@codecapitano
Copy link
Collaborator

Thank you so much @jcarres-mdsol 🙏

@codecapitano
Copy link
Collaborator

codecapitano commented Apr 16, 2024

So we added a proxy that "fixes" their format to be normal otel before hitting our otel collector.

Faro uses it's own wire protocol (!) but we also provide a transport which transforms the Faro protocol to OTLP before sending it.
With the restriction that is does not create metrics.

But in case you use Grafana Cloud you don't need it.

@jcarres-mdsol
Copy link
Author

yeah, we are using the OTLP version.
In my view telemetry pipelines should always use OTLP as protocol, this will make the community more vibrant.

@codecapitano
Copy link
Collaborator

@jcarres-mdsol did you still notice any problems or can we close the issue?

@jcarres-mdsol
Copy link
Author

I think we can close yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report a bug
Projects
None yet
Development

No branches or pull requests

2 participants