.netappdynamics

How does AppDynamics agent instrument .NET applications internally


I explore AppDynamics and other APM solutions to choose right one for my company.

I have created simple demo .NET application (WCF service and console client to consume it). Then I installed AppDynamics agent on machine and configure it for both client and service as for standalone applications:

<standalone-application executable="AppDynamicsDemo.exe">
    <tier name="Server tier" />
</standalone-application>
<standalone-application executable="AppDynamicsClient.exe">
    <tier name="Client tier" />
</standalone-application>

When I start my client and service I see that AppD agent have "injected" code to my applications and write "Running non-obfuscated client" to the console Console screenshot

I want to understand what technics or methods AppDynamics agent use to instrument .NET applications without SDK and being just a separate process (service)? How does it listen for incoming WCF calls of my service without being directly used by the service (it's not referenced as an assembly, even not mentioned in app.config)?


Solution

  • Thanks for the reply to my question. The .NET agent in most APM tools works the same way which leverages the profiler APIs in the .NET SDK and allows for data collection and also callbacks and other interception. Most of the tools also use performance counter data, and other sources aside from inside the .NET runtime. This allows you to do several things similar to Java in terms of data collection.

    ref: https://learn.microsoft.com/en-us/visualstudio/profiling/walkthrough-using-profiler-apis?view=vs-2017

    http://www.blong.com/conferences/dcon2003/internals/profiling.htm