Windows Azure Diagnostics Logging and Monitoring in the Cloud. Pradeep Kumar C Support Escalation Engineer. Agenda. WAD overview & Architecture How to Enable WAD Storage Considerations Common Diagnostic Tasks Issues & Troubleshooting Q&A. WAD overview & Architecture.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Windows Azure Diagnostics Logging and Monitoring in the Cloud Pradeep Kumar C Support Escalation Engineer
Agenda WAD overview & Architecture How to Enable WAD Storage Considerations Common Diagnostic Tasks Issues & Troubleshooting Q&A
Diagnostics: Single Server vs. the Cloud Single Server Static Environment Single well-known instance Traceable local transactions Local Access Feasible All in one TS session Data & tools co-located In-Place Changes Cloud Dynamic Environment Multi-instance, elastic capacity Distributed work loads Stateless Distributed, scaled-out data
Windows Azure Diagnostics Reason for Diagnostics in Azure Save diagnostic data that would be lost during a reimaging of the instance (an Azure Cloud Service is stateless) Provide a central repository for diagnostics from multiple role instances Diagnostic Strategy Spend time considering a diagnostic strategy for your Azure application i.e. do want to record, errors, deployment status, monitor performance How will diagnostics setting be changed once deployed? Consider cost of logging, both performance wise and financially How will you access diagnostic information?
WAD overview SDK Component provides distributed monitoring & data Collection Supports standard diagnostic APIs Cloud – Friendly Manage Multiple role instances centrally Scalable Build on Windows Azure Storage & used by scale-out/Scale-in Windows Azure Platform feature Developer in control What to Collect & When to collect
Configuring Diagnostics Enable Programmatically : using DiagnosticMonitor.Start() Enable Diagnostic with : Configuration (diagnostic.wadcfg) Enable Diagnostic with Windows Azure SDK 2.0 via Visual Studio
Diagnostic Monitor (Role Startup) DiagnosticMonitorConfiguration dc = DiagnosticMonitor.GetDefaultInitialConfiguration(); dc.WindowsEventLog.DataSources.Add("Application!*"); dc.WindowsEventLog. ScheduledTransferLogLevelFilter = LogLevel.Error; dc.WindowsEventLog.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(5.0); // add other sources DiagnosticMonitor.Start("DiagnosticsConnectionString", dc); Start off with default configuration Determine what to log and when to transfer to storage Start the monitor
Diagnostic Monitor (diagnostics.wadcfg) <DiagnosticInfrastructureLogs bufferQuotaInMB="512" scheduledTransferLogLevelFilter="Verbose" scheduledTransferPeriod="PT1S" /> <Logs bufferQuotaInMB="1024" scheduledTransferLogLevelFilter="Verbose" scheduledTransferPeriod="PT1S" /> <WindowsEventLogbufferQuotaInMB="512" scheduledTransferLogLevelFilter="Verbose" scheduledTransferPeriod="PT5M"> <DataSource name="Application!*" /> </WindowsEventLog> </DiagnosticMonitorConfiguration>
How Does It Work (in a nutshell)? Role Instance Role Instance Starts Diagnostic Monitor Starts Monitor is configured Imperatively at Start time Remotely any time via configuration file Configuration is saved in Storage Monitor buffers data locally User can set a quota (FIFO) Initiates transfer to Azure storage from local buffer Diagnostic Monitors Role Local directory storage
Diagnostic Data Locations WAD-Control-Container Contains XML Configuration for each Role Instance in the Service
Storage Considerations Set up a separate Diagnostic Storage account Choose only required Diagnostic data Use an affinity group Periodically copy and clear the Diagnostic Data from Storage Be aware of cost of logging, both physical and bandwidth
Scenarios for using WAD Monitoring application performance CPU and memory usage Requests to application Troubleshooting and Debugging issues Errors or exceptions in code Capacity planning Identify need for more compute resource
Remote Configuration Role Instance Poll Interval Role Diagnostic Monitors Local directory storage
RoleInstanceDiagnosticManager (anytime) Initialize RoleInstanceDiagnosticManager • CloudStorageAccount storage = CloudStorageAccount.Parse(…); • RoleInstanceDiagnosticManager rdm = new • RoleInstanceDiagnosticManager(storage, DeploymentId, • RoleName, RoleInstanceId); • DiagnosticMonitorConfiguration config = rdm.GetCurrentConfiguration(); • dc.WindowsEventLog.DataSources.Add("Application!*"); • dc.WindowsEventLog. ScheduledTransferLogLevelFilter = • LogLevel.Error; • dc.WindowsEventLog.ScheduledTransferPeriod = • TimeSpan.FromMinutes(5.0); • // add other sources • rdm.SetCurrentConfiguration(config); Get Current Config What to log and when to transfer it to storage Set Current Config
Troubleshooting issues with WAD Scenario Logs no longer or never copied to Azure Storage Could be all logs configured Specific logs All instances of a role or specific ones
Troubleshooting issues with WAD Troubleshooting steps Check WAD configuration RDP onto instance to check WAD processes Locally check WAD configuration Ensure logs actually exist Raise a support case
Troubleshooting issues with WAD Issue Identified WAD correctly configured No logs present to be copied i.e. IIS stopped and therefore no new IIS logs Custom logs missing due to an exception in custom code WAD incorrectly configured OverallQuotaInMb same size or larger than DiagnosticsStore for sizeInMb
References http://msdn.microsoft.com/en-us/library/windowsazure/hh771389.aspx http://www.windowsazure.com/en-us/pricing/details/storage/ http://msdn.microsoft.com/en-us/library/gg432992.aspx http://msdn.microsoft.com/en-us/library/dn205075.aspx http://msdn.microsoft.com/en-us/library/windowsazure/hh411551.aspx http://blogs.msdn.com/b/windowsazurestorage/archive/2010/04/17/windows-azure-storage-explorers.aspx http://msdn.microsoft.com/en-us/library/windowsazure/gg433048.aspx
Summary Consider WAD requirements Logging level What to log Financial cost of using WAD Decide how to monitor logs or alter Use Visual Studio or third party storage viewer Raise a support case, we are here to help
Questions For additional questions / feedback