(Optional) Enable Automatic Instrumentation

The MAUI Agent can be configured to automatically inject specific instrumentation code into your project. This can be achieved using a different beta nuget package called AppDynamics.Agent.AutoInstrument.Fody

Automatic instrumentation allows you to:

  1. Automatically track HttpClient or Refit network requests
  2. Automatically track MAUI pages
  3. Automatically track MAUI UI elements

Set Up the Automatic Instrumentation Package

Before you set up the automatic instrumentation package AppDynamics.Agent.AutoInstrument.Fody make sure you completed the agent instrumentation setup above and have added the AppDynamics.Agent or AppDynamics.Agent.MAUIpackages to your project.

  1. Add the AppDynamics.Agent.AutoInstrument.Fody package.
    Note: To install the AppDynamics.Agent.AutoInstrument.Fody beta package, check the "Include prereleases" option in order for the version to be displayed.
  2. After you build the solution, two files should be generated automatically:These files should be checked into source control.Build the solution.
    • FodyWeavers.xml
    • FodyWeavers.xsd
    Note: If the above files are not generated automatically, a new file called FodyWeavers.xml should be created manually with the following content:
    <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
    <AppDynamics.Agent.AutoInstrument />
    </Weavers>
    If the project is already using Fody, these files will already be there and only the FodyWeavers.xml file has to be updated to include the AppDynamics.Agent.AutoInstrument weaver. For example:
    <Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
    ... Existing weavers ...
    <AppDynamics.Agent.AutoInstrument />
    </Weavers>