Inside Azure Diagnostics
17 COLUMBUS, OHOCTOBER 17, 2014CLOUDDEVELOP.ORG
Opening Keynote Scott Guthrie September 25, :00am – 5:00pm PST
1. The need for diagnostic data in cloud applications 2. Data we can monitor 3. Using the Azure Diagnostic Agent 4. Real-world guidance for troubleshooting Azure apps
node.js C# Java Agile - vs - Waterfall
Diagnostics Data / Telemetry
You’re kidding? Right?
We have a problem
Resolution 1. Enable Azure diagnostics –Set key performance counters 2. Add logging statements around key functionality –Especially external services 3. Test, test, test 4. Analyze 5. Fix it
worker roles web roles
worker roles web roles Diagnostic Data – 4x
Azure Storage
Diagnostic ItemTable NameBlob Container Name Windows Event LogsWADWindowsEventLogsTable Performance CountersWADPerformanceCountersTable Trace Log StatementsWADLogsTable Azure Diagnostic Infrastructure Logs WADDiagnosticInfrastructureLogs Custom Logs (i.e. log4net, NLog, etc.) IIS LogsWADDirectoriesTable*wad-iis-logfiles IIS Failed Request LogsWADDirectoriesTable*wad-iis-failedreqlogfiles Crash DumpsWADDirectoriesTable* * Location of the blob log file is specified in the Container field and name of the blob in the RelativePath field. The AbsolutePath field contains the name of the file as it existed on the role instance.
1.Role starts 2.Diagnostic monitor agent starts 3.Diagnostics configured 4.Data buffered locally 5.Data transferred to storage
o Trace logs o IIS logs o Infrastructure logs o No transfer o OnStart() o Overrides default o diagnostics.wadcfg o Root of worker or \bin of web
public override bool OnStart() { // Create the DiagnosticMonitorConfiguration object to use for configuring the monitoring agent. DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration(); // Performance Counter configuration config.PerformanceCounters.DataSources.Add(new PerformanceCounterConfiguration { CounterSpecifier Processor Time", SampleRate = TimeSpan.FromSeconds(30) }); config.PerformanceCounters.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); // Log configuration config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Information; config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); // Event Log configuration config.WindowsEventLog.DataSources.Add("Application!*"); config.WindowsEventLog.DataSources.Add("System!*"); config.WindowsEventLog.ScheduledTransferLogLevelFilter = LogLevel.Warning; config.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); // Start the diagnostic monitor with the new configuration DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config); return base.OnStart(); } Impacts local agent only!
Deployment ID
Declarative Configuration using Visual Studio
Problem?
Additional host-level data – not DiagnosticAgent.exe
Query Azure Diagnostic Data
Compute node resource usage Windows Event logs Database queries response times Application specific exceptions Database connection & cmd failures Microsoft Azure Storage Analytics Process for Azure hosted solutions is not that different from traditional, on-premises solutions.
Questions?