≡ Menu

How to use AppDynamics to capture java method arguments and return values?

One of the major uses of an APM such as AppDynamics is the ability to collect application data at method level. For example, let’s say you have a method named processOrder in your code that accepts OrderID and Username as parameters.  What if you want to capture the Username as part of the performance metrics ?  This can be extremely valuable, for instance,  to identify which user could be submitting orders that are very slow to process. In AppDynamics, you can achieve this by using Data Collectors. In this blog post, let me show you how it is done.

  1. Log on to AppDynamics Controller UI
  2. Navigate to Configuration -> Instrumentation and click Data Collector tab
  3. You have two types of Data Collectors to choose from
    • Method Data Collector – Captures method arguments and return values.
    • HTTP Data Collector – Captures URLs, Headers and Cookies
  4. Click on Add under the Method Data Collector
  5. Configure the Method Data Collector as follows
    • Name: Provide a meaningful name for this Data Collector
    • Select Apply to new Business Transactions. If you don’t select this, you have to manually select the Business Transactions.
    • Provide the method signature (identifying a method) by its fully qualified class name and method name.
    • If the method is overloaded, i.e the same method name with various arguments, you need to select Is this Method Overloaded check box and choose the method signature you want to monitor
    • Optionally specify match condition to choose the method
    • Under Specify the data to collect from this Method Invocation, enter a display name (this is the name that will show up in Transaction Snapshots under User Data) and the data to collect. You can collect method arguments and/or return valuesAppd
  6. Note that you can also configure HTTP Data Collector if you wish you capture HTTP metadata such as URLs, Cookies and Header values.

Once you have Data Collector configured, your Transaction Snapshots will provide tremendous insight into the application performance. The HTTP Data collector metrics will appear under HTTP Data and Cookies section where as Method Invocation Data Collector metrics will appear under User Data. This is how AppDynamics provides business context to your operational data.

{ 0 comments… add one }

Leave a Comment