Azure上.ApplicationInsights.AI日志中无法解释的错误信息

fat*_*ine 3 azure azure-application-insights azure-performancecounters

我在Azure门户中设置了AppllicationInsights资源.有两种服务写入:本地Windows服务和本地服务结构集群上运行的服务结构服务.我在两个服务中使用TelemetryClient对象将数据发送到Azure ApplicationInsights资源.看起来我收到了我想要的所有消息,但是有些消息来源我不明白.以下是奇怪消息的示例:

AI:收集6个已配置的性能计数器时出错.请检查配置.计数器\ ASP.NET应用程序(?? APP_W3SVC_PROC ??)\ Requests/Sec:无法执行性能计数器的第一次读取.请确保它存在.类别:ASP.NET应用程序,计数器:请求/秒,实例SFAIUsingSrv.exe
计数器.NET CLR异常(?? APP_CLR_PROC ??)Exceps Thrown/sec的数量:无法执行性能计数器的第一次读取.请确保它存在.类别:.NET CLR异常,计数器:Exceps Thrown/sec的数量,实例
Counter\ASP.NET Applications(?? APP_W3SVC_PROC ??)\ Request Execution Time:无法执行性能计数器的第一次读取.请确保它存在.类别:ASP.NET应用程序,计数器:请求执行时间,实例SFAIUsingSrv.exe
.Counter\ASP.NET应用程序(?? APP_W3SVC_PROC ??)\应用程序队列中的请求:无法执行性能计数器的第一次读取.请确保它存在.类别:ASP.NET应用程序,计数器:请求在应用程序队列中,实例SFAIUsingSrv.exe
计数器\进程(?? APP_W3SVC_PROC ??)\句柄计数:无法执行性能计数器的第一次读取.请确保它存在.类别:进程,计数器:句柄计数,实例SFAIUsingSrv.exe
计数器\ ASP.NET应用程序(?? APP_W3SVC_PROC ??)\请求/秒:无法执行性能计数器的第一次读取.请确保它存在.类别:ASP.NET应用程序,计数器:Requests/Sec,实例SFAIUsingSrv.exe

这是我的服务结构服务的ApplicationInsights.config:

<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
  <InstrumentationKey>some instrumentation key</InstrumentationKey>
  <TelemetryInitializers>
        <Add Type="Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer, Microsoft.AI.DependencyCollector"/>
        <Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
        <Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureWebAppRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
        <Add Type="Microsoft.ApplicationInsights.WindowsServer.BuildInfoConfigComponentVersionTelemetryInitializer, Microsoft.AI.WindowsServer"/>
    </TelemetryInitializers>
    <TelemetryModules>
        <Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector">
            <ExcludeComponentCorrelationHttpHeadersOnDomains>
                <!-- 
        Requests to the following hostnames will not be modified by adding correlation headers. 
        This is only applicable if Profiler is installed via either StatusMonitor or Azure Extension.
        Add entries here to exclude additional hostnames.
        NOTE: this configuration will be lost upon NuGet upgrade.
        -->
                <Add>core.windows.net</Add>
                <Add>core.chinacloudapi.cn</Add>
                <Add>core.cloudapi.de</Add>
                <Add>core.usgovcloudapi.net</Add>
                <Add>localhost</Add>
                <Add>127.0.0.1</Add>
            </ExcludeComponentCorrelationHttpHeadersOnDomains>
        </Add>
        <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
     <!--      
      The following placeholders are supported as InstanceName:
        ??APP_WIN32_PROC?? - instance name of the application process  for Win32 counters.
        ??APP_W3SVC_PROC?? - instance name of the application IIS worker   process for IIS/ASP.NET counters.
        ??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
-->
        </Add>
        <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector"/>
        <Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer"/>
        <Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
        <Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer">
            <!--</Add>
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.FirstChanceExceptionStatisticsTelemetryModule, Microsoft.AI.WindowsServer">
-->
        </Add>
    </TelemetryModules>
    <TelemetryProcessors>
        <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector"/>
        <Add Type="Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor, Microsoft.ApplicationInsights"/>
        <Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
            <MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
            <ExcludedTypes>Event</ExcludedTypes>
        </Add>
        <Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
            <MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>
            <IncludedTypes>Event</IncludedTypes>
        </Add>
    </TelemetryProcessors>
    <TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
<!-- 
    Learn more about Application Insights configuration with ApplicationInsights.config here: 
    http://go.microsoft.com/fwlink/?LinkID=513840

    Note: If not present, please add <InstrumentationKey>Your Key</InstrumentationKey> to the top of this file.
  -->
</ApplicationInsights>
Run Code Online (Sandbox Code Playgroud)

有人能帮助我理解为什么我收到这些消息吗?

编辑: 这是我的服务(Windows服务和服务结构服务)已经产生这些消息.这两项服务都在我的开发盒上运行.因此,当没有使用任何Web应用程序时,看到与Web应用程序相关的消息非常令人困惑.但后来我注释掉ApplicationInsights.config中的PerformanceCounterCollector部分,不再生成文件消息,如果我能找到一种以更友好的方式处理这些消息的方法,我会更新我的问题.

EDIT2: 仅在服务启动时才显示这些消息.

EDIT3:以下是为服务结构服务安装的所有块包: 在此输入图像描述

在此输入图像描述

Joh*_*ner 7

如果它是Azure Web应用程序,Azure只公开了一部分perfcounter,它们在这里有一些记录:

https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/develop/Src/PerformanceCollector/Shared/Implementation/WebAppPerformanceCollector/CounterFactory.cs

如果您正在控制服务器,则需要确保运行的任何用户IIS网站/应用程序池都是Performance Monitor Users组的成员,以便它可以读取性能计数器.

这些消息来自PerfCounterCollector包的默认配置,该配置包含在WindowsServer包中,您可以在github源中看到这些包用于perf计数器收集器

如果你根本没有使用性能收集器的东西而只是希望它们全部消失,你可以删除整个

<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
...stuff about perf counters here...
</Add>
Run Code Online (Sandbox Code Playgroud)

部分和Application Insights将停止尝试完全收集性能计数器.