Instrumenting .NET applications with AppDynamics using NuGet

Introduction

One of the coolest things to come out of the .NET stable at AppD this week was the NuGet package for Azure Cloud Services. NuGet makes it a breeze to deploy our .NET agent along with your web and worker roles from inside Visual Studio. For those unfamiliar with NuGet, more information can be found here.

Our NuGet package ensures that the .NET agent is deployed at the same time when the role is published to the cloud. After adding it to the project you’ll never have to worry about deploying the agent when you swap your hosting environment from staging to production in Azure or when Azure changes the machine from under your instance. For the remainder of the post I’ll use a web role to demonstrate how to quickly install our NuGet package, changes it makes to your solution and how to edit the configuration by hand if needed. Even though I’ll use a web role, things work exactly the same way for a worker role.

Installation

So, without further ado, let’s take a look at how to quickly instrument .NET code in Azure using AppD’s NuGet package for Windows Azure Cloud Services. NuGet packages can be added via the command line or the GUI. In order to use the command line, we need to bring up the package manager console in Visual Studio as shown below

PackageManager

In the console, type ‘install-package AppDynamics.WindowsAzure.CloudServices’ to install the package. This will bring up the following UI where you can enter the information needed by the agent to talk to the controller and upload metrics. You should have received this information in the welcome email from AppDynamics.

Azure

The ‘Application Name’ is the name of the application in the controller under which the metrics reported by this agent will be stored. When ‘Test Connection’ is checked we will check the information entered by trying to connect to the controller. An error message will be displayed if the test connection is unsuccessful. That’s it, enter the information, click apply and we’re done. Easy Peasy. No more adding files one by one or modifying scripts by hand. Once deployed, instances of this web role will start reporting metrics as soon as they experience any traffic. Oh, and by the way, if you prefer to use a GUI instead of typing commands on the console, the same thing can be done by right-clicking on the solution in Visual Studio and choosing ‘Manage NuGet Package’.

Anatomy of the package

If you look closely at the solution explorer you’ll notice that a new folder called ‘AppDynamics’ has been created in the solution explorer. On expanding the folder you’ll find the following two files:

  • Installer of the latest and greatest .NET agent.
  • Startup.cmd
The startup script makes sure that the agent gets installed as a part of the deployment process on Azure. Other than adding these files we also change the ServiceDefinition.csdef file to add a startup task as shown below.

Screen Shot 2013-11-27 at 8.11.27 PM

In case, you need to change the controller information you entered in the GUI while installing the package, it can be done by editing the startup section of the csdef file shown above. Application name, controller URL, port, account key etc. can all be changed. On re-deploying the role to Azure, these new values will come into effect.

Next Steps

Microsoft Developer Evangelist, Bruno Terkaly blogged about monitoring the performance of multi-tiered Windows Azure based web applications. Find out more on Microsoft Developer Network.

Find out more in our step-by-step guide on instrumenting .NET applications using AppDynamics Pro. Take five minutes to get complete visibility into the performance of your production applications with AppDynamics Pro today.

As always, please feel free to comment if you think I have missed something or if you have a request for content in an upcoming post.

AppDynamics Pro on the Windows Azure Store

Over a year ago, AppDynamics announced a partnership with Microsoft and launched AppDynamics Lite on the Windows Azure Store. With AppDynamics Lite, Windows Azure users were able to easily monitor their applications at the code level, allowing them to identify and diagnose performance bottlenecks in real time. Today we’re happy to announce that AppDynamics Pro is now available as an addon in the Windows Azure store, which makes it easier for developers to get complete visibility into their mission-critical applications running on Windows Azure.

  • Easier/simplified buying experience in Windows Azure Store
  • Tiered pricing based on number of agents and VM size
  • Easy deployment from Visual Studio with NuGet
  • Out-of-the-box support for more Windows Azure services

“AppDynamics is one of only a handful of application monitoring solutions that works on Windows Azure, and the only one that provides the level of visibility required in our distributed and complex application environments,” said James Graham, project manager at MacMillan Publishers. “The AppDynamics monitoring solution provides insight into how our .NET applications perform at a code level, which is invaluable in the creation of a dynamic, fulfilling user experience for our students.”

Easy buying experience

Purchasing the AppDynamics Pro add-on in the Windows Azure Store only takes a couple of minutes. In the Azure portal click NEW at the bottom left of the screen and then select STORE. Search for AppDynamics, choose your plan, add-on name and region.

4-choose-appdynamics

Tiered pricing

AppDynamics Pro for Windows Azure features new tiered pricing based on the size of your VM (extra small, small or medium, large, or extra large) and the number of agents required (1, 5 or 10). This new pricing allows organizations with smaller applications to pay less to store their monitoring data than those with larger, more heavily trafficked apps. The cost is added to your monthly Windows Azure bill, and you can cancel or change your plan at any time.

AppDynamics on Windows Azure Pricing

Deploying with NuGet

Use the AppDynamics NuGet package to deploy AppDynamics Pro with your solution from Visual Studio. For detailed instructions check out the how-to guide.

2-vs-package-search

Monitoring with AppDynamics

  • Monitor the health of Windows Azure applications
  • Troubleshoot performance problems in real time
  • Rapidly diagnose root cause of performance problems
  • Dynamically scale up and scale down their Windows Azure application based on performance metrics

AppDynamics .Net App

Additional platform support

AppDynamics Pro automatically detects and monitors most Azure services out-of-the-box, including web and worker roles, SQL, Azure Blob, Azure Queue and Windows Azure Service Bus. In addition, AppDynamics Pro now supports MVC 4. Find out more in our getting started guide for Windows Azure.

Get started monitoring your Windows Azure app by adding the AppDynamics Pro add-on in the Windows Azure Store.

Monitoring .NET applications just got way better

A frustrated user calls to inform you that your .NET application is running slow in production. Pop quiz hotshot, what do you do?

The most obvious choice would be to check system resource of your IIS web servers that run your application. For example, Performance Monitor (Perfmon) in Windows gives you visibility of how an application consumes server resource like CPU, memory, disk I/O and database connection pools. Unfortunately, Windows metrics and CLR counters simply tell you how resource is being consumed by an application, they don’t tell you what application component is responsible for that consumption. Application monitoring visibility must therefore go beyond traditional server metrics and health, they need to expose what application components are responsible for poor performance.

In addition to Perfmon you might also check:

  • Windows Event Viewer
  • Log files
  • SQL Profiler
  • Visual Studio Profiler

Visual Studio is the only viable option that really provides visibility into an application and its performance. The only limitation is that Visual Studio is really a profiler/debugger for development and test environments, it was never designed for production usage. Its safe to say there’s been a lack of free or commercial tools that will monitor .NET application performance out-of-the-box, in production. That is until now.

Introducing AppDynamics Lite for .NET

Today, we’re announcing AppDynamics Lite for .NET – the first completely free .NET application monitoring solution for production. This, in addition to our commercial solution AppDynamics Pro for .NET, which has already experienced significant success since its launch in July 2011.

Why release a free monitoring solution for .NET? Because we wanted to prove that monitoring .NET application performance in production can be simple, thru software that was designed to auto-discover, configure and monitor whats relevant in your .NET application, without you lifting a finger. Our mission at AppDynamics is to deliver maximum monitoring visibility thru minimal effort.

For example, 2 minutes after downloading and installing AppDynamics Lite for .NET you might see something like this:


Application Mapping, Business Transaction Monitoring and Diagnostics for Free!

Instead of looking at Server metrics, Events and SQL profiles, AppDynamics Lite will automatically discover and visualize your .NET application. Showing all IIS web server interactions (e.g. Web services, databases, LDAP and message queus), business transactions (user requests) and associated performance metrics. End users experience business transactions, with AppDynamics Lite you now have complete business transaction context to monitor and troubleshoot what your end users experience.

For example, in the screenshot above we can drill-down on the “Update Orders” business transaction to see why it was taking 7.9 seconds:

After drilling down we now see a view showing all bad requests (known as snapshots) that were captured by AppDynamics Lite. Snapshots represent an individual execution of a business transaction that relates to a user. You can see the response time of snapshots shown in the above screenshot differ. This means some user requests were OK, some threw exceptions (red icons) and others stalled (exclamation icons).

From the above snapshots view its possible to drill-down on any snapshot to understand its code execution and latency, as well as identifying the actual root cause behind slow performance:

 In the above screenshot, AppDynamics Lite provides a view showing the code execution latency (call graph) of application classes and methods that were invoked by the slow snapshot (business transaction). Its worth stating that this visibility is available in production with minimal impact to the application running. Notice that the majority of total response time spent in this “Update Order” business transaction was spent on two ADO.NET calls which took ~3.5 seconds each.

From the above view we can see the associated SQL calls by either clicking on the ADO.NET link (next to each call) or by clicking the “SQL Calls” tab to the left of the call graph. Here we see the two SQL statements responsible for the 7.5 second response time. We can now confirm that the root cause of “Update Orders” business transaction taking 7.5 seconds was data access and two offending SQL queries.

Pro-Active Alerting for Free!

AppDynamics Lite also has pro-active dashboard and alerting capabilities. This means you can continuously monitor the performance of your application and business transactions in real-time, and be alerted via email when performance deviates from its normal baseline or threshold. For example, below is a screenshot showing a simple dashboard which has been created with four alerts (Overall App Response Time, Overall App Errors/min, Get Product Response Time and Login Response Time). You can see that the Overall App Response Time is breaching its 1 second threshold, in this scenario an alert would be fired to development or operations so they can begin troubleshooting.

All these features are completely free and will run all day in production 24/7! AppDynamics Lite is limited to a single IIS web server, with AppDynamics Pro becoming the choice for applications that are distributed across multiple IIS web servers and services.

You’re literally two minutes away from monitoring your .NET application in production. Download AppDynamic Lite for .NET or request a free 30-day trial of AppDynamics Pro for .NET.

App Man.

.NET Application Performance delivered with AppDynamics 3.3

It’s official: AppDynamics support for Microsoft .NET and Windows Azure is finally here! We’ve got the same Kick Ass Product with the same Secret Sauce–but now it sports a shiny new CLR agent. So whether your apps are Java,  .NET or hybrid, with AppDynamics you have the best of both worlds when it comes to managing application performance.

We thought it was only fair to share our secret sauce and love with the Microsoft community, given that 40,000+ users of the Java community have been enjoying it for over 18 months. Our mission is to simplify the way organizations manage their agile, complex, and distributed applications. For .NET, this means that AppDynamics supports the latest and greatest technologies from Microsoft, including their new PaaS platform Windows Azure.

So, what does this mean for organizations with .NET or Azure apps? Let me summarize:

#1 You get to visualize in real-time what your .NET application actually looks like, along with its health and performance across any distributed production environment. It’s the 50,000 foot view that shows how your application and your business performs in your data center or Windows Azure.

#2 Ability to track all business transactions that flow through your .NET application. This gives you insight into business activity, health, and impact in the event that a slowdown or problem occurs in your production environment. This unique context and visibility helps you troubleshoot through the eyes of the business, so you can see their pain instantly in production and resolve it in minutes. We auto-discover and map every business transaction automatically–so don’t worry about configuration. We’ve got that taken care of.

 

#3 Deep diagnostic information on how your business transactions actually execute through your CLRs and/or JVMs (if you’ve got a hybrid app). This means complete call stacks of code execution with latency breakdowns across all your namespaces, classes and methods, which your business transactions invoke. You get maximum visibility in production with zero configuration, allowing you to perform root cause analysis in minutes.

#4 Ability to plot, correlate, and trend any CLR or OS metric over time–whether it’s logic thread counts, garbage collection time, or simply how much CPU your application CLR is burning. We let you report and analyze all this so you understand your CLR run-time and OS system resource.

Don’t believe us? Sign up for our free 30-day trial and we’ll provision you a SaaS login. You can then download and install our lightweight agents and see for yourself just how easy it can be!

As well as our .NET support, we’ve also crammed in some great innovation into the 3.3 release.

Real-Time JVM MBean Viewer:

In addition to trending standard JMX metrics from the JVM, users can now discover and trend any MBean attributes on the fly for short term analysis in real-time. Our new UI dialogue allows the user to browse through hundreds of available metrics which are automatically discovered and reported at the touch of a button. If the user wishes to convert any MBean attribute into a standard JMX metric they can just click “Create Metric” and AppDynamics will collect and report that metric as standard in the JMX Metrics viewer.

Search Business Transactions by their content/payload:

For example, you might have launched a new product on your application or website and need to understand its performance by looking at all business transactions that interact with that product. With AppDynamics v3.3 users can now search business transactions by any transaction payload. For example, the below screenshot shows how a user can search for all business transactions that relate to the book “Harry Potter”.

Additional Platform Support:

  • Auto-discovery and mapping of LDAP, SAP and JavaMail tiers to business transaction flows for increased visibility.
  • MongoDB support allowing users to see BSON queries and associated latency for calls made from Java applications.
  • Enhanced support for WebSphere on Z/OS with automatic JVM naming pools to help customers identify and manage short-living and dynamic JVM run-times.
All in all another great release packed full of innovation from the AppDynamics team. Stay tuned over the next few weeks for more information on specific 3.3 features.
App Man.