无法监视 Azure 中的自定义性能计数器

Cannot monitor custom performance counters in Azure

我在我们的应用程序中创建了几个自定义性能计数器。当我将应用程序部署到 Azure 时,我可以在 WADPerformanceCountersTable 中看到正在收集的计数器,但我无法让它们显示在仪表板的“监视器”选项卡上。

我正在使用 Azure SDK v2.7。我修改了 diagnostics.wadcfgx 以包含以下额外的性能计数器。

<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Requests Current" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\ASP.NET\Applications Running" sampleRate="PT3M" />
<PerformanceCounterConfiguration counterSpecifier="\Ipseity\Average Aggregate Hydration Time" sampleRate="PT30S" />
<PerformanceCounterConfiguration counterSpecifier="\Ipseity\Number of Aggregate Hydrations / sec" sampleRate="PT30S" />

我实际上并不需要 \ASP.NET\Requests Current\ASP.NET\Applications Running,我只是添加它们以查看当我 select [=38] 时是否可以在对话框中显示一些内容=]

在这里您可以看到 WADPerformanceCountersTable 的一小段,表明它确实在捕获我的自定义计数器。

我已经为详细监控配置了工作者角色,但是当我转到“监控”选项卡并单击 "Add Metrics" 时,我不仅看不到我的自定义性能计数器,而且我也看不到任何其他标准我为测试目的添加的计数器(即 \ASP.NET\Requests Current\ASP.NET\Applications Running)。

根据 http://wacustomperfcounters.codeplex.com/documentation 我正在做的应该有效。

我错过了什么?

我认为我们从未在门户中看到过自定义计数器。他们(微软)只可视化他们认为重要的计数器。尝试CloudMonix以获得更多...全面的 Azure 监控无耻插件

显然这是一个已知问题,下面的文章 "To Add custom metrics to the metrics table."

部分记录了手动解决方法

https://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-monitor/#how-to-customize-the-metrics-chart

The following steps assume that you have turned on Verbose monitoring level and have configured your application to collect and transfer custom performance counters.

To display the custom performance counters in the portal you need to update the configuration in wad-control-container:

Open the wad-control-container blob in your diagnostics storage account. You can use Visual Studio or any other storage explorer to do this.

Navigate the blob path using the pattern DeploymentId/RoleName/RoleInstance to find the configuration for your role instance.

Edit the configuration file for your role instance and update it to include any custom performance counters. For example to monitor Disk Write Bytes/sec for the C drive add the following under PerformanceCounters\Subscriptions node

<PerformanceCounterConfiguration>
  <CounterSpecifier>\LogicalDisk(C:)\Disk Write Bytes/sec</CounterSpecifier>
  <SampleRateInSeconds>180</SampleRateInSeconds>
</PerformanceCounterConfiguration>

Save the changes and upload the configuration file back to the same location overwriting the existing file in the blob.

Toggle to Verbose mode in the management portal configuration. If you were in Verbose mode already you will have to toggle to minimal and back to verbose.

The custom performance counter will now be available in the Add Metrics dialog box.