Documentation forAppOptics

Code Profiling for .NET

Code profiling is currently only supported by the .NET agent for Windows.

Code profiling provides extra insight into code level execution time that is otherwise not captured by auto-instrumentation. See code profiling for general information.

AppOptics .NET agent version 3.7.0 or later is required for code profiling.

What profiling information is collected by the .NET agent?

  • Profiling information has granularity base on profiling interval (default is 50ms), and is configurable in profiler settings.
  • .NET class name and method name will be collected.
  • Asynchronous operations that are part of a request will not have profiling information captured.

Why don't all traces have profiling information?

  • Code profiling is disabled by default, please refer to enabling code profiling.
  • Traces with duration shorter than the configured profiling interval (default is 50ms) might not have profiling information.

What are the overhead concerns?

  • Overhead might be more noticeable in systems with high number of threads. To reduce overhead, increase code profiling interval such that the agent would take snapshots less frequently.

What is the "UNKNOWN" path shown in the profiles?

  • "UNKNOWN" accounts for occasions where the agent failed to obtain snapshots on the given interval. Various conditions can trigger missing snapshots, for example high CPU load.

What is the "UNMANAGED CODE" path shown in the profiles?

  • "UNMANAGED CODE" indicates that when the snapshot was attempted the code being executed was unmanaged code and the stack trace was not able to be taken.

What is the "SNAPSHOT NOT TAKEN" path shown in the profiles?

  • SNAPSHOT NOT TAKEN indicates that the snapshot was attempted but the thread was not in a state where the stack trace could be taken.

How to increase the agent log level for profiling?

If the profiling information is missing or not expected and you’d like to provide our customer support with diagnostic logging, please ensure you are running agent version 4.1.1 or above and enable verbose logging for code profiling by adding the following to the agent configuration.

<add key="LogLevel.AppOptics.Instrumentation.ProfilerService" value="Debug" />