Dynatrace.OneAgent.Xamarin NuGet package helps with auto-instrumenting Xamarin apps and offers an interface that makes it easy to add manual instrumentation to monitor additional HTTP frameworks or to tag users. The following screenshot shows a monitored Xamarin app in Dynatrace.
In Visual Studio, right-click the main project of your app and select Manage NuGet packages.
Search for Dynatrace.OneAgent.Xamarin and install the latest version.
- In Dynatrace, define a new mobile app by going to Deploy Dynatrace > Set up mobile monitoring.
The Instrumentation settings page provides details such as application ID and beacon endpoint.
Configure your app
Follow the steps below to configure your app appropriately.
On the Instrumentation page, click Google Android and select the Command line tab.
In Visual Studio, create a new file in the Assets folder of your Android project called
Dynatrace.propertiesand paste the content from the Dynatrace portal window.
If you have a Forms-based application, update your
*.Android.csproj file by adding a build target that invokes the Android auto-instrumentation.
The easiest way to edit the
.csproj file is to:
- upload the project to Visual Studio,
- and open it directly in Visual Studio.
On the Instrumentation page, select Apple iOS and open the Cocoapods tab.
Copy the PLIST code snippet into the existing
Info.plistfile in your Visual Studio project.
To prevent OneAgent for mobile from being stripped out of the iOS app as part of optimizations, add a startup call to your app.
Monitor web requests in your Forms project
Dynatrace automatically monitors web requests that are made using the frameworks that are available natively on Android and iOS. If you trigger requests directly from your .NET code, they can be captured only manually by the Mobile Agent. So, we've provided an interface for the commonly used HttpClient framework that allows you to set up request instrumentation with a single line of code. All other types of requests have to be instrumented differently.
Crashes are reported automatically. Dynatrace doesn't support
.pdb files. Symbolication is only available based on Proguard mapping files or iOS dSYM files.