gpt4 book ai didi

asp.net - .Net Application Insights 2.5 不跟踪 HTTP 请求

转载 作者:行者123 更新时间:2023-12-02 21:25:13 28 4
gpt4 key购买 nike

我有一个 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>

最佳答案

将以下部分添加到我的 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>

关于asp.net - .Net Application Insights 2.5 不跟踪 HTTP 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49056199/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com