We are trying to add the auto instrumentation to our application and we observed in the events and actions in dashboard its been picking up only Activity names, how we can add the configuration to pick up the fragment names also?
So it will be easy to track back the class names easily.
I can confirm that automatic monitoring of fragment lifecycle events is not available. But you can manually instrument fragments and report the events via a custom user action. The plugin automatically adds the OneAgent SDK as dependency to your application and no additional setup step is needed.
Thank you for the reply, but we are using the Auto instrumentation, in this case how we can pick up the fragment class names?
Custom user action -- means do we need to add the below in the fragments, to get the fragment names?? if so what is the point of doing the auto instrumentation ?
DTXAction action = Dynatrace.enterAction(“Fragment class name”);
The term “manually instrument” in my last comment means that you enhance the monitoring data (generated by auto-instrumentation) by instrumenting additional parts of the app via manual calls to the OneAgent SDK. In the official documentation, it is referred to as “Enhance mobile user experience data by using the OneAgent SDK for Android.”
Custom user action -- means do we need to add the below in the fragments, to get the fragment names?? if so what is the point of doing the auto instrumentation ?
The plugin still uses the other sensors and instrument activities, web requests, user interactions …, so you don’t have to manually instrument them. For fragments, you have do instrument them manually. The instrumentation depends on what you want to monitor (class name, lifecycle events, time duration until the fragment is visible, …). The provided snippet is a good starting point to get more familiar with the OneAgent SDK. But currently it would only monitor the fragment class name. By adjusting the location of the enterAction and leaveAction method call, you could monitor how long it takes to display/create the fragment. Or you could add lifecycle events via the reportEvent API.