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

时间:2017-07-21 20:48:26

标签: 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 ??)#of   Exceps Thrown / sec:无法执行第一次性能读取   计数器。请确保它存在。类别:.NET CLR例外,   counter:Exceps Thrown / sec,实例
  计数器\ ASP.NET应用程序(?? APP_W3SVC_PROC ??)\请求执行时间:无法执行性能计数器的第一次读取。请确认   存在。类别:ASP.NET应用程序,计数器:请求执行   时间,实例SFAIUsingSrv.exe
.Counter \ ASP.NET   应用程序(?? APP_W3SVC_PROC ??)\应用程序队列中的请求:失败   执行性能计数器的第一次读取。请确认   存在。类别:ASP.NET应用程序,计数器:请求输入   应用程序队列,实例SFAIUsingSrv.exe
  计数器\进程(?? APP_W3SVC_PROC ??)\句柄计数:无法执行第一个   读取性能计数器。请确保它存在。类别:   进程,计数器:处理计数,实例SFAIUsingSrv.exe
计数器   \ ASP.NET应用程序(?? APP_W3SVC_PROC ??)\ Requests / Sec:失败   执行性能计数器的第一次读取。请确认   存在。类别:ASP.NET应用程序,计数器:请求/秒,   实例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>
  

有人能帮助我理解我收到这些消息的原因吗?

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

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

EDIT3:以下是服务结构服务的所有nugget软件包安装: enter image description here

enter image description here

1 个答案:

答案 0 :(得分:5)

如果它是Azure Web App,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 source for the perf counter collector

中看到

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

<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
...stuff about perf counters here...
</Add>

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

相关问题