24 May 2023 06:18 AM - last edited on 29 May 2023 06:06 AM by AgataWlodarczyk
Our React.js SPA executes different API calls as routes change and different components load. We rarely see these XHR calls in Dynatrace RUM, however, sometimes we do, and sometimes we don't.
Any information regarding this would be helpful. Seems like it catches api calls directly called off the click of a button. However, something like logging in - it catches the initial authentication api, the user is then transitioned to a post-login page which then loads additional data pertaining to that user. Many times, most of these api calls are missing.
The answer is - it depends. Any chance your user action gets closed before the XHR call happens? Sometimes there are options which help such as enabling setTimeout. Not knowing details on your application, but I'd guess the XHR is not captured since it's somehow called in a way that Dynatrace is not able to link it with user action. You can try using this solution, at least temporarily. However, I'd not recommend doing it and you should try solving it in a different way.
Be sure to check the troubleshooting hints here. Still, there are situations where calling the dtrum API is inevitable.
We will poke around on that. Is there any reason you would not recommend that solution? It seems to just display more user actions.
Actually, any XHR request would trigger a user action, even without interaction. User action is designed to capture interaction performed by a user or a significant action which has a business value.