asp.net - Application Insights 的应用程序 map 不显示依赖项调用

标签 asp.net azure dependencies azure-application-insights

我们已将 Application Insights 添加到部署到 Azure Web 应用服务的 Asp.Net 4.5.1 应用程序中。它使用 Entity Framework 和 SqlCommands 调用数据库。

Application Insights 通过 JavaScript 和后端添加。 JavaScript 跟踪正在运行,从 Fiddler 跟踪的调用和 Azure 门户中显示的报告数据都可以看出。

对 Web 服务器的请求也会显示在报告中,但应用程序映射图表不会显示从 Web 服务器到数据库的任何依赖项调用,也不会显示任何其他依赖项。

ApplicationInsights.config 是您从“创建新项目”中获得的标准配置,但删除了 InstrumentationKey 元素。检测 key 在 global.asax 中设置为

Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey = applicationInsightsKey;

另外网络配置包含

<system.web>
    <httpHandlers>
      <add path="CombineScriptsHandler.axd" verb="*" type="AjaxControlToolkit.CombineScriptsHandler, AjaxControlToolkit" />
    </httpHandlers>
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
    </httpModules>

...

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="ApplicationInsightsWebTracking" />
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
    </modules>

如何从 AI 跟踪的 Web 服务器获取数据库查询数据?

更新

我将 Web 项目升级到 .Net 4.6.1,并开始看到一些依赖项,但看不到实际的 SQL 查询文本。为了解决这个问题,我通过 Azure 门户在应用服务中安装了 AI Status Monitor 扩展。之后,我完全没有看到任何依赖项调用,并且包含 ApplicationInsightsExtension.log:

9/29/2016 12:15:45 PM: [Verbose] Loading assembly from D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Microsoft.ApplicationInsights.WebSiteManager.dll
9/29/2016 12:15:45 PM: [Verbose] Starting Application Insights installation and configuration...
9/29/2016 12:15:46 PM: [Verbose] Loading assembly from D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Microsoft.ApplicationInsights.WebSiteManager.dll
9/29/2016 12:15:46 PM: [Verbose] Starting Application Insights Profiler configuration...
9/29/2016 12:15:46 PM: [Verbose] Current processor architecture: x86
9/29/2016 12:15:46 PM: [Verbose] Starting to download/install 'Microsoft.ApplicationInsights.Agent_x86' nuget package from D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\appinsights...
9/29/2016 12:15:46 PM, [Verbose] Installing 'Microsoft.ApplicationInsights.Agent_x86', version '2.0.0' ...
9/29/2016 12:15:47 PM, [Verbose] Installed 'Microsoft.ApplicationInsights.Agent_x86', version '2.0.0'.
9/29/2016 12:15:47 PM: [Verbose] End of 'Microsoft.ApplicationInsights.Agent_x86' nuget package download/install.
9/29/2016 12:15:47 PM: [Verbose] Ready to copy files from D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Packages\Microsoft.ApplicationInsights.Agent_x86.2.0.0\content\RTIA\x86 to D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\Agent
9/29/2016 12:15:47 PM: [Verbose] Microsoft.ApplicationInsights.Extensions.Base_x86.dll.Name was copied.
9/29/2016 12:15:47 PM: [Verbose] Microsoft.ApplicationInsights.ExtensionsHost_x86.dll.Name was copied.
9/29/2016 12:15:47 PM: [Verbose] Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll.Name was copied.
9/29/2016 12:15:47 PM: [Verbose] Microsoft.InstrumentationEngine.Extensions.config.Name was copied.
9/29/2016 12:15:47 PM: [Verbose] MicrosoftInstrumentationEngine_x86.dll.Name was copied.
9/29/2016 12:15:47 PM: [Verbose] End of Application Insights Profiler configuration.
9/29/2016 12:15:47 PM: [Verbose] Loading config from D:\home\site\wwwroot\ApplicationInsights.config
9/29/2016 12:15:47 PM: [Verbose] Application is already instrumented with Application Insights version: 2.1.0.0
9/29/2016 12:15:47 PM: [Verbose] End of Application Insights installation and configuration.

那么如何通过 sql 查询文本日志记录来获取依赖项日志记录呢?

我有预感,如果我在 applicationinsights.config 文件中有遥测 key ,那么这会起作用,但我想从应用程序设置中以编程方式进行设置。

最佳答案

据此:https://azure.microsoft.com/en-us/documentation/articles/app-insights-dependencies/

要获取依赖项,您需要安装状态监视器或将应用程序升级到 .NET Framework 4.6 或更高版本。

关于asp.net - Application Insights 的应用程序 map 不显示依赖项调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39573603/

相关文章:

正在重新创建 Azure 容器实例

android - Intellij 12 maven library Android RestTemplate 麻烦处理javax/xml/parser/DocumentBuilder.class

dependencies - 如何排除 Maven 插件中的依赖关系?

asp.net - 让用户在上传前检查文件

asp.net - Linq 按子表排序

java - 为什么通过 Android 向 ASP.NET MVC 站点发送 POST 数据时会出现错误 500?

java - 如何在 maven 3 中获取最新的 RELEASE 版本的依赖项?

javascript - 将客户端处理程序从内容页添加到母版页控件

Azure VM 出站 TCP 连接在几分钟后中断

javascript - Webrole 没有启动并且总是很忙