Troubleshooting Windows Azure diagnostics using the Diagnostic Infrastructure Logs

5 באוגוסט 2012

One of my favorite jams of windows azure is the use of theWindows-Azure-Logo-New diagnostics.wadwcg file for setting up windows azure diagnostics. This is a great alternative for configuring the The Windows Azure diagnostics infrastructure in code.

Last week I had an issue working on a customer deployment where I just could not get trace logs using the diagnostics.wadcfg configuration. I was getting the Windows Event Logs that was also configured just fine, but for some reason the trace logs would just not come through.

Setting the diagnostics.wadcfg (just like setting the configuration in code) basically generates another configuration file (per role per deployment) in a container called wad-control-container:

the wad-control-container

Opening the configuration file I have discovered that wile the the diagnostics infrastructure loaded my Windows Event logs configuration correctly, the configuration for the trace logs was not loaded at all:

image

Another thing you can monitor using the Windows Azure diagnostics infrastructure is the Windows Azure diagnostics infrastructure. To set up the Windows Azure diagnostics infrastructure logs, I just added the DiagnosticInfrastructureLogs section to the diagnostics.wadcfg file:

<?xml version="1.0" encoding="utf-8" ?>
<DiagnosticMonitorConfiguration xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration"
                                configurationChangePollInterval="PT1M"
                                overallQuotaInMB="4096">
  <Logs bufferQuotaInMB="1024"
        scheduledTransferLogLevelFilter="Verbose"
        scheduledTransferPeriod="PT1M"/>
  <DiagnosticInfrastructureLogs bufferQuotaInMB="1024" 
                                scheduledTransferPeriod="PT1M" 
                                scheduledTransferLogLevelFilter="Verbose"/>
  <WindowsEventLog bufferQuotaInMB="1024" 
                   scheduledTransferPeriod="PT1M" 
                   scheduledTransferLogLevelFilter="Information">
    <DataSource name="System!*"/>
  </WindowsEventLog>
</DiagnosticMonitorConfiguration>

Now I could start my solution and the Windows Azure diagnostics infrastructure created a table called WADDiagnosticInfrastructureLogsTable:

image

looking around I have found the following exception:

Message string  Polling for configuration changes:System.InvalidOperationException: There is an error in XML document (8, 8). —> System.FormatException: Input string was not in a correct format.

   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)

   at System.Xml.XmlConvert.ToInt32(String s)

   at Microsoft.WindowsAzure.Diagnostics.XmlSerializationReader1.Read7_BasicLogsBufferConfiguration(Boolean isNullable, Boolean checkType)

   at Microsoft.WindowsAzure.Diagnostics.XmlSerializationReader1.Read11_DiagnosticMonitorConfiguration(Boolean isNullable, Boolean checkType)

   at Microsoft.WindowsAzure.Diagnostics.XmlSerializationReader1.Read14_ConfigRequest(Boolean isNullable, Boolean checkType)

   at Microsoft.WindowsAzure.Diagnostics.XmlSerializationReader1.Read27_ConfigRequest()

   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

   — End of inner exception stack trace —

   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)

   at System.Xml.Serialization.XmlSerializer.Deserialize(Stream stream)

   at Microsoft.WindowsAzure.Diagnostics.ControlChannel.<>c__DisplayClass10.<ConfigMonitoringPoll>b__f()

   at Microsoft.WindowsAzure.Diagnostics.ControlChannel.TryExpectError(HttpStatusCode status, Action act)

   at Microsoft.WindowsAzure.Diagnostics.ControlChannel.ConfigMonitoringPoll(Object sender, ElapsedEventArgs args); TraceSource 'Microsoft.WindowsAzure.Diagnostics' event

Apparently the was something wrong with my configuration and one of the integer values (probably the bufferQuotaInMb). I actually spent half a day trying to figure out what was wrong (I was just curious) but could not find out what was wrong, so I just rewrote the XML element.

Conclusion

There are actually two things I am taking with me from this experience. The first thing I have learned is that even if the Windows Azure diagnostics infrastructure can not parse parts of the diagnostics.wadcfg file it will use the parts it can. But most of all I learned how informative and helpful the Windows Azure diagnostics infrastructure logs can be.

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*