-
Notifications
You must be signed in to change notification settings - Fork 550
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
Link user interaction spans to most recent navigation #732
Comments
This would require changes in a couple of the instrumentations. First, you have to change the document load plugin to save the most recent navigation somewhere (probably context), then you would have to modify the user interaction plugin to read that context property and make use of it. I think this is a good idea that is worth exploring. Do you think you have time to prototype something so we can discuss it further? This might be also something worth adding to the specification as it affects instrumentation for other types of UIs like android/ios apps. |
Makes sense. I imagine this could be store in the root context? If we assume that navigation always occurs as a root span, I believe this would be possible. Even though the Document Load won't actually be the root span if the traceparent meta tag is set, we can still store the most recent client navigation in the root span.
Yup, I can try to put together a prototype 🔧 |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
@dyladan can we keep this issue open? |
Yes of course |
Hey it appears as though this has been implemented. Is there any way to turn this off? We poll our api on a single page (don't ask :D) and this has lead to building up some massive traces which isn't great |
@dyladan, don't suppose you can help with the above? |
I don't think this has been implemented? |
what instrumentations are you using? |
We're currently using the following instrumentation's:
|
@Ancient-Dragon this has not been implemented. This issue is suggesting to connect the DocumentLoad spans (from the document load instrumentation) with the Navigation spans (from the user interaction instrumentation) via OpenTelemetry Links. This specification is for linking causally related spans that contain entirely different root spans. This is only applicable for SPAs, as MPAs will always generate a new document load span. I think page loads and subsequent client side navigations would be useful context for finding client side errors in SPAs that contain state. It looks like you want to disable the network spans being generated after the page load. Your example is showing a Navigation span with nested XHR/Fetch spans. If you don't want those network spans recording your app's network waterfall within client side navigations, I would recommend programmatically disabling the XHR/Fetch instrumentation after the page load. |
Ok thanks, I was unaware the the user interaction instrumentation was adding these navigations spans. I was able to filter them out using the shouldPreventSpanCreation to filter them out based on the user clicking the link to that page, as I still want the spans / traces being generated for the http requests. Sorry about the confusion. |
I think that's good feedback for the User Interaction Instrumentation. I agree, I think it would make sense to be able to disable client-side navigation spans via configuration. I don't know the history of why those spans exist in that instrumentation in the first place, but I remember being surprised when I saw it generated by User Interaction since it's an undocumented feature. I feel like a more natural place is actually within DocumentLoad Instrumentation, but instead of calling it that it would be something like "Navigation Instrumentation". |
Is your feature request related to a problem? Please describe
I would find it useful if user interaction spans were linked via the span options to the previous navigation span (including the document load). When a user interacts with the page, this would allow user interactions to be connected to the specific navigation on which the user interaction occurred. This added context would allow a better understanding of the user flow that we wish to observe.
Describe the solution you'd like to see
The previous navigation span (as created by the user interaction plugin) or the document load span (as created by the document load plugin) are linked into a user interaction span using the
link
SpanOption.Describe alternatives you've considered
I've considered creating a span that runs the duration between navigations to capture this context. However, this has clear downsides since the page could be open for a long time.
Additional context
There is an open issue that this feature could partially address: #668.
However, it would only address resources loaded during user interactions. Any resources fetched outside the context of a click handler would not be linked. It also requires usage of the user interaction plugin.
I believe that it might also partially address open-telemetry/opentelemetry-js#610
The text was updated successfully, but these errors were encountered: