05 Jan 2022 01:50 PM - last edited on 10 Jan 2022 09:49 AM by MaciejNeumann
Hi Team,
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.
Thanks
Naga
Solved! Go to Solution.
05 Jan 2022 01:53 PM
our confgiruation is like below, in base build.gradle file
dynatrace {
configurations {
NgaConfig {
autoStart.enabled false
}
}
}
and starting the dynatrace in one of the start up fragment of the application
Configuration config = new DynatraceConfigurationBuilder(
"<Application ID>",
"<Beacon URL>")
.withDebugLogging(false)
.withCertificateValidation(true)
.withCrashReporting(true)
.buildConfiguration();
Dynatrace.startup(context, config);
Dynatrace.identifyUser(<Random session ID>);
05 Jan 2022 08:13 PM
Hello @Naga ,
Fragment sensors are disabled by default. I believe you need to enable them in the configuration in the lifecycle monitoring block . See more in the DSL documentation.
10 Jan 2022 12:55 PM
Hello @Julius_Loman,
When enabling the fragment sensors we get this error:
Fragment instrumentation is not available in this version
I assume then that fragment sensors aren't yet available? Any other help is appreciated!
11 Jan 2022 10:11 AM
hey @JoshuaBradbury,
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.
11 Jan 2022 10:19 AM
Hi @Anonymous,
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");
action.leaveAction();
Please correct me if my understanding is wrong.
Thank you,
Naga
11 Jan 2022 11:39 AM - edited 11 Jan 2022 11:39 AM
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."
@Naga wrote: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.