Using IntelliTrace to Diagnose Problems with a Hosted Service

Exclusive offer: get 50% off this eBook here
Microsoft Windows Azure Development Cookbook

Microsoft Windows Azure Development Cookbook — Save 50%

Over 80 advanced recipes for developing scalable services with the Windows Azure platform with this Microsoft Azure book and eBook

$29.99    $15.00
by Neil Mackenzie | August 2011 | Cookbooks Enterprise Articles Microsoft

A Windows Azure hosted service may comprise multiple instances of multiple roles. These instances all run in a remote Windows Azure data center—typically 24*7. The ability to monitor these instances non-intrusively is essential both in detecting failure and in capacity planning.

However, there are times, especially early in the development process, when non-intrusive diagnostics monitoring is not sufficient. In this article by Neil Mackenzie, author of Microsoft Windows Azure Development Cookbook, we will see the benefits of intrusive monitoring of a Windows Azure role instance using IntelliTrace.

 

Microsoft Windows Azure Development Cookbook

Microsoft Windows Azure Development Cookbook

Over 80 advanced recipes for developing scalable services with the Windows Azure platform

        Read more about this book      

(For more resources on this subject, see here.)

Windows Azure Diagnostics provides non-intrusive support for diagnosing problems with a Windows Azure hosted service. This non-intrusion is vital in a production service. However, when developing a hosted service, it may be worthwhile to get access to additional diagnostics information even at the cost of intruding on the service.

The Visual Studio 2010 Ultimate Edition supports the use of IntelliTrace with an application deployed to the cloud. This can be particularly helpful when dealing with problems, such as missing assemblies. It also allows for the easy identification and diagnosis of exceptions. Note that IntelliTrace has a significant impact on the performance of a hosted service. Consequently, it should never be used in a production environment and, in practice, should only be used when needed during development.

IntelliTrace is configured when the application package is published. This configuration includes specifying the events to trace and identifying the modules and processes for which IntelliTrace should not capture data. For example, the Storage Client module is removed by default from IntelliTrace since otherwise, storage exceptions could occur due to timeouts.

Once the application package has been deployed, the Windows Azure Compute node in the Visual Studio Server Explorer indicates the Windows Azure hosted service, roles, and instances which are capturing IntelliTrace data. From the instance level in this node, a request can be made to download the current IntelliTrace log. This lists:

  • Threads
  • Exceptions
  • System info
  • Modules

The threads section provides information about when particular threads were running. The exceptions list specifies the exceptions that occurred, and provides the call stack when they occurred. The system info section provides general information about the instance, such as number of processors and total memory. The modules section lists the loaded assemblies.

The IntelliTrace logs will probably survive an instance crash, but they will not survive if the virtual machine is moved due to excessive failure. The instance must be running for Visual Studio to be able to download the IntelliTrace logs.

In this recipe, we will learn how to use IntelliTrace to identify problems with an application deployed to a hosted service in the cloud.

Getting ready

Only Visual Studio Ultimate Edition supports the use of IntelliTrace with an application deployed to a hosted service in the cloud.

How to do it...

We are going to use IntelliTrace to investigate an application deployed to a hosted service in the cloud. We do this as follows:

The first few steps occur before the application package is deployed to the cloud:

  1. Use Visual Studio 2010 Ultimate Edition to build a Windows Azure project.
  2. Right click on the Solution and select Publish....
  3. Select Enable IntelliTrace for .Net 4 roles.
  4. Click on Settings... and make any changes desired to the IntelliTrace settings for modules excluded, and so on.
  5. Click on OK to continue the deployment of the application package.

The remaining steps occur after the package has been deployed and the hosted service is in the Ready (that is, running) state:

  1. Open the Server Explorer in Visual Studio.
  2. On the Windows Azure Compute node, right click on an instance node and select View IntelliTrace logs.
  3. Investigate the downloaded logs, looking at exceptions and their call stacks, and so on.
  4. Right click on individual lines of code in a code file and select Search For This Line In IntelliTrace.
  5. Select one of the located uses and step through the code from the line.

How it works...

Steps 1 through 5 are a normal application package deployment except for the IntelliTrace configuration.

In steps 6 and 7, we use Server Explorer to access and download the IntelliTrace logs. Note that we can refresh the logs through additional requests to View IntelliTrace logs.

In steps 8 through 10, we look at various aspects of the downloaded IntelliTrace logs.


Further resources on this subject:


Microsoft Windows Azure Development Cookbook Over 80 advanced recipes for developing scalable services with the Windows Azure platform with this Microsoft Azure book and eBook
Published: August 2011
eBook Price: $29.99
Book Price: $49.99
See more
Select your format and quantity:

About the Author :


Neil Mackenzie

Neil Mackenzie has worked with computers for nearly three decades. He started his computer career doing large-scale numerical simulations for scientific research and business planning. Since then, he has been involved primarily in healthcare software, developing electronic medical records systems. He has been using Windows Azure since PDC 2008 and has used nearly all parts of the Windows Azure platform – including those that no longer exist. Neil is very active in the online Windows Azure community – in particular, helping to solve many of the questions raised in the MSDN Windows Azure Forums. He is a Microsoft MVP for Windows Azure.

Books From Packt


Microsoft SQL Azure Enterprise Application Development
Microsoft SQL Azure Enterprise Application Development

Getting Started with Microsoft Application Virtualization 4.6
Getting Started with Microsoft Application Virtualization 4.6

Microsoft Azure: Enterprise Application Development
Microsoft Azure: Enterprise Application Development

Applied Architecture Patterns on the Microsoft Platform
Applied Architecture Patterns on the Microsoft Platform

Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications
Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications

Microsoft Silverlight 4 and Windows Azure Enterprise Integration: RAW
Microsoft Silverlight 4 and Windows Azure Enterprise Integration: RAW

Microsoft SharePoint 2010 and Windows PowerShell 2.0: Expert Cookbook
Microsoft SharePoint 2010 and Windows PowerShell 2.0: Expert Cookbook

Least Privilege Security for Windows 7, Vista and XP
Least Privilege Security for Windows 7, Vista and XP


Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software