我在 Azure 门户中设置了 AppllicationInsights 资源。有 2 个服务写入它:本地 Windows 服务和在本地服务结构集群上运行的服务结构服务。我在这两个服务中都使用TelemetryClient对象将数据发送到 Azure ApplicationInsights 资源。看起来我收到了我想要的所有消息,但是有些消息的来源我不明白。这是奇怪消息的示例:
AI:收集 6 个已配置的性能计数器时出错。请检查配置。计数器 \ASP.NET Applications(??APP_W3SVC_PROC??)\Requests/Sec: 未能执行性能计数器的第一次读取。请确保它存在。类别:ASP.NET 应用程序,计数器:Requests/Sec,实例 SFAIUsingSrv.exe
Counter .NET CLR Exceptions(??APP_CLR_PROC??)# of Exceps Throw/sec: 未能执行性能计数器的第一次读取。请确保它存在。类别:.NET CLR 异常,计数器:# of Exceps Throw / sec,实例
Counter \ASP.NET Applications(??APP_W3SVC_PROC??)\Request Execution Time: 未能执行性能计数器的第一次读取。请确保它存在。类别:ASP.NET 应用程序,计数器:请求执行时间,实例 SFAIUsingSrv.exe
.Counter \ASP.NET Applications(??APP_W3SVC_PROC??)\Requests In Application Queue: 未能执行性能计数器的第一次读取。请确保它存在。类别:ASP.NET 应用程序,计数器:应用程序队列中的请求,实例 SFAIUsingSrv.exe
计数器 \Process(??APP_W3SVC_PROC??)\Handle 计数:未能执行性能计数器的第一次读取。请确保它存在。类别:进程,计数器:句柄计数,实例 SFAIUsingSrv.exe
计数器 \ASP.NET Applications(??APP_W3SVC_PROC??)\Requests/Sec: 未能执行性能计数器的第一次读取。请确保它存在。类别:ASP.NET 应用程序,计数器:Requests/Sec,实例 SFAIUsingSrv.exe
这是我的 Service Fabric 服务的 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: 这些消息仅在服务启动时显示。