It’s the final day of //build/ 2015, and I’m sad. Sad to leave San Francisco, sad to fly a redeye back to Louisville (and arrive back on Derby day), and sad to leave //build/. This has been a great //build/ experience for me. I’ve spoken to a lot of developers and Microsoft team members.
Application Insights for Any App: A Must-Have Tool for Understanding Your Customers
“If you can’t measure something, you can’t understand it. If you can’t understand it, you can’t control it. If you can’t control it, you can’t improve it.” – H. James Harrington
The Modern Application Lifecycle
Today’s application lifecycle is a trade-off between Development and Operations. There are a lot of challenges in the Develop, Test, and Release lifecycle. How do you prioritize new features, once a feature is ready for deployment, how you you deploy it quickly? How do you monitor for baseline behavior to determine if you’ve created problems? And finally, when there’s an error, how d you correct it as quickly as possible to reduce downtime.
What Does Application Insights Do?
Application Insights is an agnostic tool that can collect telemetry information. It can be deployed in Azure and on-premise. Once deployed, it can give you a 360 degree view of your application – availability, performance, and user behavior. This information is in front of you in a single user interface. AI also provides a presentation-centric view of this information. The user interface is designed around giving you actionable steps to take and true insights into your application. The built-in analytics help to identify your application’s behavior.
Out of the box, you et a summary of your application’s health – availability, performance, and usage. Each high-level area provides drill-down insights into each category. 2 tools (Metrics Explorer and Diagnostic Search) exist in drill-down views to understand your application. Metrics Explorer is a multi-dimensional data explorer. Diagnostic Search provides detail into application failures and crashes, drilling down directly to exception details, as well as aggregate failure analysis.
In addition to the out of the box capabilities, you can add custom metric and events that can automatically roll up into the dashboard area. This capability enables you to target specific application logic workflows that you want to better understand.
AI is not just for .NET. It can analyze Ruby, Python, iOS, Android, Javascript, PHP, and many more.
Implementing Application Insights
When you originally create your project in Visual Studio, you can automatically add AI. This allows you to instrument your application from day 1. For existing projects, simply click on the web project in Visual Studio and select “Add Application Insights”. After this step, add the Javascript snippet provided on the Azure portal.
Cool Features
One of the really cool features of AI is dependency duration tracking. This feature automatically detects when your application calls out to external services or databases, and tracks the time it takes to communicate with these dependencies. In a drill-down view of the dependencies, it can break down each dependency by type and instance. For example, if you have an Azure queue that acts as a dependency, it will give you the specific queue name and instance, so you can understand how long that dependency consumes in your application logic workflows. This can help you to proactively determine which area(s) of your application the team should focus on for performance and troubleshooting. The best part of this feature – it comes for free. Just turn on AI and you get this level of detail.
HoloLens Panel
See my previous HoloLens post for details on this session and an overview of HoloLens as a technology and experience.
Building Consumer and Enterprise Device Solutions with Windows 10 IoT
In this session, I learned about Windows 10 IoT Core, which is a platform for developing on IoT devices. something interesting the presenter led with is IoT devices don’t necessarily have a visible circuit board. The new Lumia phones running Windows Mobile 10 are IoT devices, and only cost $45-$65.
In the first demo, we saw a single Universal Windows Application (UWA) deployed and running on a Windows Phone and a Raspberry Pi without any code changes. The applicaiton polled a public web service that provided weather data (temperature, humidity, etc.).
In the second demo, the UWA demo app was modified to interface with a local temperature hardware component.
AllJoyn
One important component of IoT is communication between devices. AllJoyn is an open platform for communication and authentication. All Windows 10 devices will come with AllJoyn capabilities built into them, so that all Windows 10 IoT devices will be able to natively speak AllJoyn. Microsoft has gone level further and has provided an AllJoyn bridging technology to allow non-AllJoyn devices to interface and communicate. The importance here is having a single API for interfacing across all devices. Coupled with the power of Azure, you can use hosted Azure services to communicate with all of your devices in a simple way.
Historical Debugging with IntelliTrace in Visual Studio 2015
To start, IntelliTrace is a debugging tool, and in this session we’ll learn how to be more productive. Often, we are asked to fix a bug, but it’s in a part of an application that I’ve never seen before, or I need to fix a bug that takes 10-15 minutes to setup (for reproducibility), or it’s code that is not reproducible in your development environment.
IntelliTrace monitors your running applications for “interesting” events. Interesting events (config file reads, button presses, database queries, exceptions, etc.).
IntelliTrace lets you look at your data of events captured. You can access this data form the Diagnostic Tools window. To use this window, first pause your app in VS and scroll through the events int he window. You can click on the events and scroll ot the code that triggered the event (historically). A combination of the stack trace and these historical events can change your workflow.
Current debugging starts by deciding where to place your breakpoint and using “step into” or “step over” workflows. With IntelliTrace, the first thing you should do is “break all” on your solution. Find events in the Diagnostic Tools Window. Events can be located in the event list or via the timeline. the timeline is powerful because you can drill-down into details easily, filtering by time period.
Async Code Debugging
With IntelliTrace, async code debugging is simple. Using the events of Diagnostic Tools, you simply click on the exception and you’re brought to the exact line of code, instead of the “normal” place visual Studio brings you to – the top-level statement you are awaiting.
Remote data Collection
So, what happens when you have an app running in production? You can download and install the IntelliTrace Standalone Collector, use PowerShell to begin monitoring, wait for the exception to occur, stop the monitoring with Powershell, save a .itrace file, which contains all the necessary information to debug your application.
Other integrations exist with Microsoft Test Manager and Microsoft Monitoring Agent.
Summary
A key take-away form this session is that I’m stuck in a pre-IntelliTrace world. I’m a classic F10/F11 debugger. Stepping through code has some advantages (learning the codebase); however, on a codebase I really understand, tracking down that bug is tedious. IntelliTrace is a way to get to your bug much more quickly, while visualizing a timeline of application events.