Fixing failing Windows Azure Diagnostics logging

Posted on Saturday, December 5, 2015

In one of my projects I'm having multiple Cloud Services that use ETW logging and use Windows Azure Diagnostics (WAD) to upload the logs into Azure Table Storage.
After I upgraded the Cloud Services to a new version, the logging suddenly failed.
I enabled Remote Desktop on one of the Worker Roles and logged on the the machine to check the Windows Event Viewer.
There I saw the following 3 errors:

  • Exception in validating the XML file:C:\Resources\directory<RoleName>.DiagnosticStore\WAD0105\Configuration\MaConfig.xml Error:The element 'CounterSets' has incomplete content. List of possible elements expected: 'CounterSet'.
  • Failed to convert WAD1.1 config to Monagent config format
  • DiagnosticsPlugin launch failed with exit code -108

I started debugging the problem by first validating the active diagnostics settings using the Cloud Explorer in Visual Studio.
This showed me ETW logging was enabled.
For debugging purpose I enabled all diagnostics data and after that the ETW logging also started working again.

In the end, it turned out that the DiagnosticsPlugin failed to launch because I didn't have the PerformanceCounters section in my WadCfgx file.
After adding the part below to the file and updating my Cloud Services with this, the DiagnosticsPlugin was working again.

<PerformanceCounters scheduledTransferPeriod="PT1M">
  <PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT3M" />
  <PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time" sampleRate="PT3M" />
</PerformanceCounters>

Disclaimer: Any views or opinions expressed on this blog are my own personal ones and do not represent my employer in any way.