By default, AppDynamics captures tons of useful metrics from your java application. Average response time of your Applications, JDBC response times, Throughput, Heap and Garbage Collection Metrics etc. In addition, AppDynamics automatically captures Transaction Snapshots (that provide deep diagnostics) periodically and during slow response times. The snapshots will reveal the hotspots up to the method level.
But at times, you may want to monitor a particular method for performance metrics. For example, you may want to know how often a method named ‘cancelOrder’ is called and how long it takes to process. For requirements like this, AppDynamics provides a neat way of instrumenting your java method – Information Points.
To configure a new Information Point, navigate to Analyze -> Information Points. Click on the New button at the top.
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.
- Log on to AppDynamics Controller UI
- Navigate to Configuration -> Instrumentation and click Data Collector tab
- 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
- Click on Add under the Method Data Collector
- 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 values
- Note that you can also configure HTTP Data Collector if you wish you capture HTTP metadata such as URLs, Cookies and Header values.
Glad you are here. It’s time to take a deeper look at all the various monitoring metrics that AppDynamics provides. We have so far done the following:
- Installed AppDynamics Controller
- Installed a sample application (Node.js,REST and mysql) and installed appdynamics agent
- Ensured the application shows up in the controller UI.
Note that we have not customized any monitoring elements yet. i.e whatever we are going to see is out-of-the box, which is one of the coolest things about AppDynamics. Let’s start.
How to view the Flow Map of the Application ?
Application flow map provides an excellent view of the data flow of the application. AppDynamics automatically tracks all the inbound and outbound calls of the instrumented application and attempts to draw this flow map. It is like an interactive Visio Diagram of the application infrastructure architecture that you did not create. (AppDynamics created it for you). Let’s take a look at the Flow Map of the sample application we have instrumented.
So you have installed AppDynamics Controller, instrumented a simple Java Application and even viewed it from AppDynamics Controller UI. You have come a long way. Excellent work! In this blog post, I’ll take you a step further by showing you how to view critical Application Metrics in the UI. In order to get to see various monitoring metrics, let us use a more sophisticated application (one with a backend database).
Fortunately a sample application is available at github specifically for this purpose. Kudos to the developers who made this available to all of us. The application is based on Docker (no surprise there) so you need to have Docker installed in your server that you are planning to use as the Application host. If you don’t want to go this route, simply instrument one of your applications (preferably in Dev environment).
Here are the steps to install the docker based sample application.
- Clone the git repo
git clone https://github.com/Appdynamics/SampleApp.git
Now that you have your AppDynamics Controller up and humming, the next step is to instrument an Application to see the awesomeness of AppDynamics in practice.
For this blog post, I’ve chosen a very simple Java Web Application running on a tomcat server (It is the ‘sample’ application that comes with tomcat). The instrumentation process is fairly straight forward. While what I’m about to show is fairly manual, in real world scenarios involving hundreds of servers, you will be using some sort of automation 🙂
At high level, here is the procedure:
- Download the agent software either from the controller UI, or from appdynamics website
- Copy the agent software to the target application server (which is to be instrumented)
- Update the java command line that starts the application to instrument AppDynamics and restart the Application Server.
Ready ? Let’s get started.
OK. So, you want to get AppDynamics controller installed on your Mac. Perhaps you want to test the awesome power of AppDynamics locally before purchasing the product. Great. In this blog post, I’m going to show you how to get AppDynamics Controller installed on your Mac. Let’s get to work.
- Login to https://aperture.appdynamics.com/download/
- Scroll down on the left pane and select the Mac check box
Virtualization is a technique using which you can run multiple Operating Systems (aka Guest) in a physical server (host) by abstracting (or virtualizing) CPU, Memory, Disk and Network resources. The core component of any virtualization solution is Hypervisor – the software that performs the abstraction of bare metal resources.
Here are the primary benefits of using Virtualization:
- Save cost on hardware
- Centrally manage the infrastructure
- Add effective fault tolerance and high availability
- Dynamically update the infrastructure
The diagram below shows virtualization at a high level.
Yes, AppDynamics is awesome for Application monitoring – Java Heap, deep transaction tracing, tons of out-of-the-box framework monitoring (JDBC,WebService etc) and the list goes on. But do you know Appdynamics can be used to effectively monitor Servers too, whether it is virtual or physical? When I say server, I mean the host operating system such as RedHat Enterprise Linux, Windows 2012, Solaris etc. Let me show you how you can do this.
Enter AppDynamics Machine Agent
While Java can be monitored using a Java Agent, a Server can be monitored using a special type of agent called Machine Agent. You will have to have license to run these agents (When you purchase Application agents, typically AppDyanmics throws the same number of Machine Agents, and so you should be good in terms of additional cost). If you are not sure about your present licensing situation, click on ‘licensing’ in your Controller UI as shown below.
Unlike Application agents which run inside the JVM/CLR, Machine agent is a standalone Java program that runs on the host operating system. It collects hardware metrics and sends them to Controller (once a minute). A user can view these metrics via Controller UI. Pretty simple, hah?
Java Heap is a labyrinth. You can spend hours or even days analyzing a heap dump from a production Java application. Heap is where all the objects created by your application live. And even in a relatively simple application, there could be hundreds of thousands of objects created. When dealing with Java memory leak, you know you are looking for one the following (or both):
- Excessive number of objects of certain class
- Objects with unusually large size
Fortunately, Appdynamics provides a feature using which you can easily reveal both of the above cases. Let’s get right to it.
- In AppDynamics Controller UI, locate the Node that you want to troubleshoot and click on ‘Memory’ tab
In this part, let’s explore AppDynamics facilities for diagnosing Memory Leaks. AppDynamics provides two powerful tools to hunt down memory leaks.
- Automatic Leak Detection
- Objet Instance Tracking
Automatic Leak Detection
With Automatic Leak Detection enabled, Appdyanmics can capture objects that live longer than usual period – i.e long lived Collection objects that simply won’t get garbage collected. If your application is leaking memory, it is definitely one of these long-living, never-dying objects that cause the leak. Use the following procedure to make use of this tool.