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?
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.
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.