25 Jun 2019 04:18 PM
I tried to instrument an hybrid application with the dynatrace cordova plugin. It worked fine and all the actions get traced, except the external xhr actions.
The problem is that the plugin expects a hybrid xhr call, like if it was in the browser. But, in this case, all the network calls are managed by an external native plugin that can't be removed.
The plugin that we are using is advanced-http, if it could be useful.
I'd like to know if there is a way to trace the requests invoked inside a plugin, or if there's a workaround to get a full analytics in the console.
Thank you
Solved! Go to Solution.
25 Jun 2019 07:54 PM
As Cordova plugin is basically infecting RUM JS agent into web part of your application, only Idea I have is using custom user actions / manual instrumentation:
https://www.dynatrace.com/news/blog/create-and-monitor-custom-user-actions/
But this means that you will need to mark all XHR’s as custom actions what can be hard. Maybe writing wrapper for this plugin which will be instrumented is solution here?
Sebastian
26 Jun 2019 06:08 AM
The Auto instrumentation of the Mobile Agent will catch the request.
Using this plugin has one downside with Dynatrace. The JSAgent will not report a user action anymore, as it only reports user actions with XHR. The XHR is now happening on the native side and will therefor be catched by the Mobile Agent. But you wont see this request in the user session as there is no connected user action. You will see the request of course in the application overview.
26 Jun 2019 09:16 AM
Thank you both for the fast and complete answers and thank you for understanding the problem.
@Matthias H. Where can I find the services called in the application overview?
In the dashboard I can select two different application, since the native part and the webview have been instrumented separately. If I select the webview app, I don't find any "called services" item. If I select the native app I find the item, but I don't find any request inside.
Am I doing something wrong?
@Sebastian K. In our architecture, we are using some IBM WAS that will be instrumented to have a more complete overview of services called. Using custom actions, I'm afraid that dynatrace won't be able to join the analytics of both the parts and it could present the result as two independent applications.
I had also thought about writing a wrapper, but I want to keep this solution as last.
27 Jun 2019 02:06 PM
As you already noticed the services should be in the Mobile Application. This is because your request are done by the native side and not within web. The Web Request should also be visible within the Mobile Application. (Click on Network Performance and then select the domain, here you should see the different requests)
27 Jun 2019 02:14 PM
Too bad, in that page I only see the requests performed by the native application. Isn't this a sign that the plugin hasn't been instrumented?
27 Jun 2019 02:19 PM
You said you are using advanced-http. How do you make the other requests?
03 Jul 2019 02:44 PM
The cordova plugin is only used by the hybrid application
08 Jul 2019 02:56 PM
Okay. I misunderstood then. So you are saying that you have a plain native application and a hybrid application. But again you said above that you are using the advanced-http plugin.
The advanced-http plugin gives a Hybrid application the option to make a network request natively. According to my understanding (and the GitHub docs) it uses the Android http-request library, which uses HttpUrlConnection. The Mobile Agent will detect the usage of HttpUrlConnection and will instrument this. As the Cordova plugin also triggers this instrumentation the requests should be tracked. If this really doesn't work - I would like to continue via support case where we have a deeper look at the problem.
So making a request with advanced-http plugin contains no JS interaction or what so ever. The whole connection happens on the native side.