【问题标题】:Application Insights tracking only failed ASP.NET MVC Web API requestsApplication Insights 仅跟踪失败的 ASP.NET MVC Web API 请求
【发布时间】:2017-07-07 13:11:03
【问题描述】:

我有一个提供 saveAndNew 操作的 ASP.NET Web API 控制器。

这个类如预期从 System.Web.Http.ApiController 派生而来。

使用 SDK 2.1.0 版和 ApplicationInsights.config 中的默认设置正确配置了 Application Insights。

如果对上述操作的请求失败 - 例如状态代码为 400 - 请求被正确记录在 App Insights 中。

问题在于如果操作成功(状态代码 200)Application Insights 中没有任何记录

我使用 Fiddler 查看是否向 App Insights 跟踪服务发出了请求,但事实并非如此。所以问题不在于 Azure 门户上的 Application Insights 配置。

我不知道是什么阻止了对我的 Web API 控制器操作的所有请求被记录。

谁能帮忙?

【问题讨论】:

    标签: azure-application-insights


    【解决方案1】:

    您可能想尝试在 ApplicationInsights.config 文件中删除/注释掉 TransferRequestHandler

    GitHub 问题 “REST API 应用程序可以过滤掉所有请求” here 指出:“注释掉 ApplicationInsights.config 中的一行导致成功的请求开始被记录。Web API 2 个项目。

    <!--<Add>System.Web.Handlers.TransferRequestHandler</Add>-->
    

    【讨论】:

      猜你喜欢
      • 2018-08-09
      • 2015-09-15
      • 1970-01-01
      • 2019-09-27
      • 1970-01-01
      • 1970-01-01
      • 2012-01-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多