-
Notifications
You must be signed in to change notification settings - Fork 137
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
Incorrect transaction duration for pages after redirect #1279
Comments
Hi @trainings, Thanks for reaching out! Bear in mind that the RUM page-load transaction will end just after the browser fires the page load event. The agent does not keep state between full-page refreshes which means that every page will have each own page-load transaction. Important to mention that it's possible to disable the page-load instrumentation so you can start and end such transaction manually, that tends to be common in SPAs given that you might want to decouple "my SPA is fully loaded/bootstrapped" from the load event the browser fires. On your particular scenario this might not help since it seems that you are doing redirects that force the browser to fully refresh. In a future version of the agent we will introduce the concept of user sessions which will provide (among other things) with the possibility of seeing every page-load transaction grouped together under the same session id. Thanks, |
I feel like I've been misunderstood. For example - I have a page with page-load-time 3sec. What we have: This negatively affects the metric |
Hello everyone, seems we have the same problem |
Hi everyone, our team met the same problems, what is the current state of issue and may be there is some temporary solution? |
Hi everyone, The bug has been found. Unlike createNavigationTimingSpans, when we create createResourceTimingSpan we are NOT substracting fetchstart from the span start and end properties. In a nutshell, we are not creating these spans relative to when the current page has been requested. This is important since performance entry times include the time spent before the redirection happened. Example (node.js server): http://localhost:3000/the-server-will-redirect-this.html
Once the redirection is performed, we can see how the navigation spans are correctly set: However, the resource timing spans are not: When skipping the redirection, we can see how the resource timing spans are correctly set: We will give priority to this fix Thanks, |
Hi all! Are there any news and when is it planned to fix this problem? Last release was June 14th, |
Hi @devcorpio!
Thanks! |
Would be great to get an update on this issue |
Just a quick update on this. We are aiming to get this issue resolved and shipped in the next couple of months alongside several other RUM agent improvements. |
…ns and transaction.
@devcorpio can we make a difference for redirects within the same site/origin and redirects to third party systems?
If I understand right, navigation timing browser API should return 0 for redirects to cross-origin, can we have similar behavior? UPD: Seems like 3rd-party redirects are not counted. Sorry for confusion. |
Hi everyone, There has been more discussions and investigation into this within the team. It's not possible programmatically to identify if there has been a cross-origin redirect (something that also @oxcafedead stated recently), so browser APIs set everything related to redirect to 0. Because of this, an eventual solution for the original problem described in the issue would be hacky (using navigationStart for this is not as reliable as it might seem at first instance) and prone to cause bugs (even breaking changes) that might affect different scenarios. On top of that, the current behaviour is aligned with how a browser and other tools work and we want to be aligned with how they do things, let me show you an example: redirect-demo.movThe video shows a cross-origin redirect (from localhost:3001 to localhost:3000). This redirection takes place (it lasts 1,5s) while we are doing a performance recording with Chrome. In the late stages of the video, you will see how all the marks identified by the browser (e.g. LCP, FPC, DLC) also include the redirection timing in the marks, for instance, LCP happens in 1,87s Although we understand that it would be great to differentiate the time a user spent in a different origin and the time spent on the actual page, that's something that browsers currently don't allow us to identify. In fact, for browsers, the time a user spent in the browser before the redirection is also part of the user experience. As previously mentioned, what we can confirm we are going to do is to fix the agent behaviour if redirect info is available (this happens when it is a same-origin one), this can be broken down in a few steps:
So, instead of this: We should have something like this: I understand that not doing what you asked for is unfortunate, hope you find the motives described above reasonable, we can assure you we have reflected plenty on this. Additionally, I would like to thank you again for helping us to keep improving the product, the redirect (same-origin) behaviour we are going to fix is a clear example of how useful your feedback is. Cheers, |
@devcorpio, maybe we can use PerformanceNavigationTiming interface instead of PerformanceTiming to create navigation spans. PerformanceNavigationTiming uses relative timing values instead of timestamps so its timings will be aligned with Resource Entry timings, LCP timings, etc. In case of cross-domain redirect PerformanceNavigationTiming properties values will also include the duration of the redirect. So we will be able to detect that some action was happened before the navigation events were really triggered. In this case we will be able to draw this action as the first span in the waterfall, like in the example of the future fix provided by you. Thx. |
Dear @devcorpio, and how about the fix for cross-domain redirect? Thank you in advance. |
Hi @fonshirin, Sorry for the delay, I was waiting for the release before adding here a comment. When we discussed the cross-origin with the team. We also mentioned the possibility of switching to PerformanceNavigationTiming, but for now, we discarded that option for how big and sensitive the change might be for the agent. Additionally, we decided that for now (as I also mentioned in the previous comment), we want the RUM agent to behave like browsers do (meaning, including the extra redirection to the total time) We will retackle this in future versions of the agent (most likely when we switch PerformanceNavigationTiming, but that's not going to happen in the short/mid-term) Additional actions:
I'll link them to this ticket (for reference) once we create them Thanks, |
We use token handler pattern for enforcing authentication for web applications.
Steps:
everything is standard, but:
page load transaction measured from point 1 (not 4)
on the sample of a transaction, gaps for items 2 & 3
The text was updated successfully, but these errors were encountered: