首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >天青。ApplicationInsights。AI日志中令人费解的错误混乱

天青。ApplicationInsights。AI日志中令人费解的错误混乱
EN

Stack Overflow用户
提问于 2017-07-21 20:48:26
回答 1查看 7.2K关注 0票数 7

我已经在Azure门户中设置了AppllicationInsights资源。它有两个服务: windows服务在前提下运行,服务fabric服务运行在本地服务fabric集群上。我在这两个服务中都使用TelemetryClient对象向Azure ApplicationInsights资源发送数据。看起来我收到了我想要的所有消息,但有些消息的来源我不明白。下面是奇怪消息的示例:

AI:错误收集6个配置的性能计数器。请检查配置。计数器Applications(??APP_W3SVC_PROC??)\Requests/Sec:未能执行性能计数器的第一次读取。请确认它的存在。类别: ASP.NET应用程序,计数器:请求/Sec,实例SFAIUsingSrv.exe 计数器.NET CLR异常(??APP_CLR_PROC??)#异常抛出/秒:未能执行第一次读取性能计数器。请确认它的存在。类别:.NET CLR异常,计数器:抛出/秒异常的#,实例计数器\ASP.NET应用程序(??APP_W3SVC_PROC??)\请求执行时间:未能执行对性能计数器的第一次读取。请确认它的存在。类别: ASP.NET应用程序,计数器:请求执行时间,实例SFAIUsingSrv.exe 应用程序队列中的.Counter \ASP.NET应用程序(??APP_W3SVC_PROC?)请求:未能执行第一次读取性能计数器。请确认它的存在。类别: ASP.NET应用程序,计数器:应用程序队列中的请求,实例SFAIUsingSrv.exe 计数器\进程(??APP_W3SVC_PROC??)\句柄计数:未能执行对性能计数器的第一次读取。请确认它的存在。类别:处理,计数器:句柄计数,实例SFAIUsingSrv.exe 计数器Applications(??APP_W3SVC_PROC??)\Requests/Sec:未能执行性能计数器的第一次读取。请确认它的存在。类别: ASP.NET应用程序,计数器:请求/Sec,实例SFAIUsingSrv.exe

以下是服务结构服务的ApplicationInsights.config:

代码语言:javascript
复制
<?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和services服务)一直在产生这些消息。这两项服务都在我的开发盒上运行。因此,当没有使用任何网络应用程序时,看到那些与网络应用程序相关的信息是相当令人困惑的。但是,我在ApplicationInsights.config文件消息中注释掉了ApplicationInsights.config部分,如果我能找到一种更友好的方式来处理这些消息,我会更新我的问题。

EDIT2:这些消息只有在服务启动时才会出现。

EDIT3:这里是为服务fabric服务安装的所有金块包:

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-22 01:17:44

如果Azure Web应用程序是Azure Web应用程序,则Azure只公开其中的一个子集,在这里有一些文档:

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

如果您正在控制服务器,您需要确保无论哪个用户正在运行IIS / app池都是Performance Monitor Users组的成员,以便它能够读取perf计数器。

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

如果您根本没有使用性能收集器,而只想让它全部消失,您可以删除整个

代码语言:javascript
复制
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
...stuff about perf counters here...
</Add>

节和应用程序洞察将停止收集perf计数器的尝试。

票数 14
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45246491

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档