Cloud Service Application Insights ETW 问题

Cloud Service Application Insights ETW issues

我正在尝试让我的 Azure 辅助角色的日志显示在 Application Insights 中。当我 运行 Get-AzureServiceDiagnosticsExtension 我得到以下...

<PublicConfig
xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
  <WadCfg>
    <DiagnosticMonitorConfiguration overallQuotaInMB="8192" sinks="applicationInsights.errors">
      <DiagnosticInfrastructureLogs scheduledTransferLogLevelFilter="Verbose" />
      <PerformanceCounters scheduledTransferPeriod="PT1M">
        <PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes"
sampleRate="PT3M" />
        <PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time"
sampleRate="PT3M" />
      </PerformanceCounters>
      <WindowsEventLog scheduledTransferPeriod="PT1M">
        <DataSource name="Application!*[System[(Level=1 or Level=2 or Level=3)]]" />
        <DataSource name="Windows Azure!*[System[(Level=1 or Level=2 or Level=3 or Level=4)]]" />
      </WindowsEventLog>
      <EtwProviders sinks="applicationInsights" />
      <CrashDumps dumpType="Full">
        <CrashDumpConfiguration processName="WaAppAgent.exe" />
        <CrashDumpConfiguration processName="WindowsAzureGuestAgent.exe" />
        <CrashDumpConfiguration processName="WaWorkerHost.exe" />
        <CrashDumpConfiguration processName="DiagnosticsAgent.exe" />
      </CrashDumps>
      <Logs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Verbose" />
      <Metrics resourceId="/subscriptions/{My_Subscription_GUID}/resourceGroups/Group/providers/Microsoft.ClassicCompute/domainNames/MyCloudServiceName" />
    </DiagnosticMonitorConfiguration>
    <SinksConfig>
      <Sink name="applicationInsights">
        <ApplicationInsights />
        <Channels>
          <Channel logLevel="Verbose" name="errors" />
        </Channels>
      </Sink>
    </SinksConfig>
  </WadCfg>
  <StorageAccount>myclassicstorage</StorageAccount>
</PublicConfig>

以下内容来自使用 Set-AzureServiceDiagnosticsExtension

上传的原始 diagnostics.wadcfgx 文件
<PrivateConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
    <StorageAccount name="{myclassicstorage}" key="{MyClassicStorageKey}" endpoint="https://myclassicstorage.blob.core.windows.net/" />
</PrivateConfig>

使用 Azure 存储资源管理器,我可以连接到 myclassicstorage,我可以在 WADLogsTable 中看到我想要的条目,但是当我转到 Application Insights 时,什么都没有...

看来我的跟踪条目正在存储,但我的 Application Insights 没有从存储中获取数据。

无论如何,问题的答案可能会导致失败的解释:-

  1. 选择 "Storage Account" 还是 "Storage Account (classic)" 重要吗?

  2. ServiceConfiguration.Local.cscfg 中有一个 Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString,ServiceConfiguration.Cloud.cscfg 加上 diagnostics.wadcfgx 文件中的 StorageAccount。为什么要设置storage的地方有3个,应该放什么(我设置的都是一样的)

  3. 在许多示例中,diagnostics.wadcfgx 文件中的 StorageAccount 端点设置为 https://core.windows.net 应该设置什么?

好吧,它刚刚开始工作。我相信答案是按如下方式更改 EtwProviders 配置...

<EtwProviders>
  <EtwEventSourceProviderConfiguration provider="WaWorkerHost.exe">
    <DefaultEvents />
  </EtwEventSourceProviderConfiguration>
</EtwProviders>

我通过查看发布到 WADLogsTable

的数据得到 "WaWorkerHost.exe"

EventName="MessageEvent" Message="2016-06-01 03:17:50,924 [14] INFO myservice.TaskProcessing [(null)] - Core Completed - Next due date 2016-06-01T03:18:27.5430000 " TraceSource="WaWorkerHost.exe"