16 May 2023 03:37 PM - last edited on 18 May 2023 06:11 PM by AgataWlodarczyk
Is there any easy-to-implement way to avoid leaving an action while a web request started during a custom action is still processing?
The action I'm currently considering triggers after some computation XHR calls so the XHR calls are not associated with the user action and so I had to use custom actions instead of automatically detected actions.
The action is associated with many parallel requests which themselves can trigger other XHR calls and various GET requests, there is no fixed order in which these requests end so it is not possible to place the LeaveAction at the end of a specific request.
Is there any way to tell Dynatrace to leave Action only when all the requests have ended?
21 May 2023 11:04 AM - edited 21 May 2023 11:13 AM
Hello.
Perhaps someone will recommend another solution.
I would try this path:
add code (not dtrum API) - which will help the frontend determine - that all parallel requests have loaded - the action has been completed, and to have dtrum.leaveAction call in this code.
dtrum.leaveAction (somevar);
Sometimes there is focus to XHR mapping instead to have right "User action duration time",
This is not the best solution, especially when we cannot add a lot of code and waste developers' time, but call dtrum.leaveAction - when the requests have exactly ended (for example if we know some timeouts - 21s 540ms). We lose the user action duration but all XHR are mapping in this case correctly. (Also sometimes we add "action duration' as as user action properties)
You need to try to talk with your developers - maybe they already have a code that definitely signals the end of processing requests.
Regards,
Alex Romanenkov
22 May 2023 08:17 AM
Hello, thank you for your suggestion.
My client is searching for a measurement of user action duration rather than XHR mapping.
I'll keep your advice in mind if I'll need to do some XHR mapping in other contexts.
Kind Regards,
Pietro Maldini