Page 44 - MSDN Magazine, May 2017
P. 44

DEVOPS
Optimize Telemetry with
Application Insights
Sergey Kanzhelev and Victor Mushkatin
The importance of monitoring your service is self-evident. In this article, we’ll focus on fundamental techniques to make your monitoring investments manageable. For the purpose of this discussion, “manageable” means that whatever telemetry you collect about your service, while actionable, doesn’t consume an unreasonable amount of resources.
When everything works smoothly, you don’t necessarily care aboutterabytesoflogdatacollectedfortheserviceexecution.You only care about the general trends. However, when the service goes down or performs poorly, you need everything—and then some— to diagnose the issues. How do you keep the balance between data that’s required to detect the problem and needs to be collected all the time, from the data that’s required to troubleshoot the prob- lem and needs to be collected, well, when it needs to be collected?
To illustrate the techniques, we’ll use the Microsoft Azure Appli- cation Insights Service and its highly extensible SDK model. While concepts we cover are universally applicable, our goal is to make you familiar with Application Insights SDK out-of-the-box capa- bilities and extensibility points that let you make your “telemetry exhaust” manageable. After reading this article, you’ll be able to understand the Application Insights domain model, how telemetry iscollected,andwhatcodingtechniquesareavailabletodecrease the amount of telemetry, while preserving monitoring capabilities, analytical accuracy, and diagnosing depth.
Unbound Volume of Telemetry
Take a service that processes 1 billion transactions a day. If you log all details about every transaction, you’ll be able to answer all sorts of questions—for example, questions about transaction latency 95th percentile from a particular geolocation, or failure rate for users running a particular browser. In addition to these monitor- ing metrics, you’ll be able to support users when they call and ask specific questions about their failed transaction by looking into logs. The more data you collect, the wider range of questions you can answer by analyzing application telemetry.
But it all comes with a price. Even with low prices for the telem- etry collection (bit.ly/2nNhp3c), do you really need to collect 1 billion data points? Or worse, if every transaction makes one call to SQL Database, do you really need to collect an additional 1 billion data points for all SQL Database calls? If you add up all possible telemetry that might be needed in order to monitor, troubleshoot and analyze your service execution, you might find the infrastructure to support it to be quite expensive, significantly affecting ROI of the monitoring.
This article discusses:
• Application Insights data model and extensibility points
• Four main techniques for telemetry data reduction
• How to improve the monitoring data ROI for high-volume applications
• Ways to collect statistically representable subsets of application telemetry
Technologies discussed:
Application Insights, Web Applications, Monitoring, Tracing
Code download available at:
bit.ly/2nhwfxn
38 msdn magazine


































































































   42   43   44   45   46