【问题标题】:Does Application Insights depend on the Azure SDK?Application Insights 是否依赖于 Azure SDK?
【发布时间】:2018-08-16 15:40:55
【问题描述】:

自从添加 IntelliTrace 后,我注意到在 Azure IaaS VM 上运行时寻找 Microsoft.WindowsAzure.ServiceRunTime.dll 的应用程序洞察的许多例外。

//旁注

值得注意的是,这些异常似乎没有在应用程序洞察门户中报告,除了有时我注意到某些图表中有大量 异常但无法找到异常详细信息(直到使用 IntelliTrace) .... 但这可能是一个红鲱鱼,因为他们可能正在被TopShelf 吞噬。

//结束旁注

经过研究,我了解到这个 dll 实际上是在 Azure SDK 中,而不是 nuget 包。

不想为我的服务添加额外的先决条件,我倾向于添加扩展程序集引用并复制到本地。

版本不同,寻找 2.5.0.0 所以还添加了绑定重定向到 2.7.0.0

但是现在这样做会导致

  • 抛出异常异常:Microsoft.WindowsAzure.ServiceRuntime.dll 中的“System.IO.FileNotFoundException”(“无法加载文件或 程序集'msshrtmi,版本=2.7.0.0,文化=中性, PublicKeyToken=31bf3856ad364e35' 或其依赖项之一。这 系统找不到文件 指定。") System.IO.FileNotFoundException

我担心每次我修复某些东西时,我都需要修复其他东西,然后再修复其他东西......

这让我回到了原来的查询...... 实际问题... :-)

我没有发现任何表明 Application Insights 甚至需要安装 Azure SDK 的信息。这让我想知道这些异常是否实际上是 Application Insights 只是询问是否安装了 Azure SDK 的第一次机会异常?

作为参考,应用洞察设置:

我的 Application Insights nuget 包是:

  <package id="Microsoft.ApplicationInsights" version="2.5.0" targetFramework="net462" />
  <package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.4.0" targetFramework="net462" />
  <package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.5.0" targetFramework="net462" />
  <package id="Microsoft.ApplicationInsights.PerfCounterCollector" version="2.5.0" targetFramework="net462" />
  <package id="Microsoft.ApplicationInsights.WindowsServer" version="2.5.0" targetFramework="net462" />
  <package id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.5.0" targetFramework="net462" />

我的配置包括这些 TelemetryInitializers:

<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>

            <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>
        <IncludeDiagnosticSourceActivities>
            <Add>Microsoft.Azure.EventHubs</Add>
            <Add>Microsoft.Azure.ServiceBus</Add>
        </IncludeDiagnosticSourceActivities>
    </Add>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
    </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>
</TelemetryModules>

应用程序洞察是由其他人设置的,我想知道其中一个扩展是否造成了问题,它是针对 Windows 服务的。

【问题讨论】:

    标签: azure-application-insights azure-sdk


    【解决方案1】:

    Application Insights 本身托管在 Azure 中,但 Application Insights SDK 本身对任何 Azure SDK 没有依赖项。 (您不需要您的应用在 azure 中运行发送数据到 Application Insights)

    您可能正在使用的其他东西可能具有 Azure 依赖项,但没有 AI。

    如果您正在查看有关 .net 异常的网站或虚拟机指标,则该指标适用于整个框架中的抛出异常。如果您在 AI 门户中没有看到异常,则表示它们从未被 AI 处理或被 AI 跟踪。

    【讨论】:

      猜你喜欢
      • 2017-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多