.Net Application Insights 2.5不跟踪HTTP请求

问题描述 投票:3回答:1

我有一个ASP .Net MVC应用程序,它使用Application Insights进行遥测跟踪。从使用localhost的任何开发人员计算机调试应用程序时,它工作正常,但是当部署到我们的主开发环境Web服务器时,不再跟踪HTTP请求。

其他所有内容,包括异常,依赖项,跟踪,都在正确跟踪。但HTTP请求不是。我怎样才能找到这个问题的原因?我不知道从哪里开始。

我们正在使用Application Insights SDK 2.5.0.61767。所有计算机上的配置文件都是相同的。不确定还有什么可能导致它。欢迎任何建议。

编辑:我注意到它也没有收集服务器响应时间,服务器请求和失败的请求。

我在ApplicationInsights.config文件中有以下模块配置:

<Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web">
  <Handlers>
    <!-- 
    Add entries here to filter out additional handlers: 

    NOTE: handler configuration will be lost upon NuGet upgrade.
    -->
    <Add>System.Web.Handlers.TransferRequestHandler</Add>
    <Add>Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler</Add>
    <Add>System.Web.StaticFileHandler</Add>
    <Add>System.Web.Handlers.AssemblyResourceLoader</Add>
    <Add>System.Web.Optimization.BundleHandler</Add>
    <Add>System.Web.Script.Services.ScriptHandlerFactory</Add>
    <Add>System.Web.Handlers.TraceHandler</Add>
    <Add>System.Web.Services.Discovery.DiscoveryRequestHandler</Add>
    <Add>System.Web.HttpDebugHandler</Add>
  </Handlers>
</Add>
asp.net asp.net-mvc azure azure-application-insights
1个回答
4
投票

将以下部分添加到我的web.config已经解决了我的问题。

<system.webServer>
  <modules>
      <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" />
      <add name="ApplicationInsightsHttpModule" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
  </modules>
</system.webServer>
© www.soinside.com 2019 - 2024. All rights reserved.